Questions tagged [datagridviewcomboboxcell]

DataGridViewComboBoxCell allows you to select a value for the respective DataGridView cell, from the list of values (available in popup displayed). The user can select item by clicking on an item or can use arrow keys to pick up from the available list or can type a value.

196 questions
2
votes
1 answer

How to fill a DataGridViewComboBoxColumn?

Sorry if this is something that should be obvious, but this is my first project using VB.NET, and some things are still beyond me. I'm trying to setup a combobox inside a DataGridView but I keep getting System.ArgumentException:…
2
votes
1 answer

Weird problem with DataGridViewComboBoxCell, trying to autocommit changes

So my goal is once a user clicks on the item from the dropdown list, the cell will automatically call EndEdit(). The weirdest thing is that the code below will work on the 2nd-n ComboBoxesCells that I drop down and select values from but NEVER the…
Tom
  • 1,270
  • 2
  • 12
  • 25
2
votes
2 answers

Set default value for DataGridView ComboBox

My application consist of DataGridviewComboBoxColumn inside DataGridView. The ComboBoxColumns are getting filled from a database table (key, value pair). I am trying to set the default value for ComboBox column using DefaultValuesNeeded event but it…
2
votes
2 answers

VB.Net DatagridviewComboBoxColumn CellClick behavior

I have a DatagridviewComboBoxColumn populated from a DataTable and whenever I click on any part of the DataGridViewComboBoxCell the first value of the list shows up as it had been clicked. However, when I move the focus to another cell without…
2
votes
1 answer

Autosize a DataGridViewComboBoxCell which uses custom painting

My DataGridView has a DataGridViewComboBoxColumn on it. This is my custom cell painting handler: private void dataGridView_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) { if (e.ColumnIndex == 1 && e.RowIndex >= 0) { …
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
2
votes
2 answers

Cell from DataGridViewCheckBoxColumn Checked programmatically

I'm trying to check cells from a DataGridViewCheckBoxColumn. I want to do it programmatically. Here is my DatagridView: DataGridViewCheckBoxColumn dataChecked = new DataGridViewCheckBoxColumn(false); this.dataGrid.Columns.Add(dataChecked); My…
Ed.Q
  • 23
  • 3
2
votes
3 answers

Datagridview comboboxcell will not set to readonly = false

I have a datagridview with a column (Ports) that I want to use to dislay available ports on machines on my local subnet. If there is one or less port I use a textbox cell - if more than 1 I use a comboboxcell. The combobox cell refuses to drop and…
2
votes
2 answers

DataGridViewComboBoxCell.ReadOnly = true, but can still change the selected value

I am strugling with a problem with DataGridView and DataGridViewComboBoxCell in C# (Visual Studio 2013, .NET 4.5.1) The DataGridView has 3 columns with DataGridViewComboBoxColumn and 3 columns with DataGridViewTextBoxColumn. The DataGrid is bound to…
user1419056
  • 733
  • 1
  • 5
  • 9
2
votes
3 answers

How to programatically populate a DataGridViewComboBoxColumn in VB.net?

I have been scratching my head for a while over this. So I have added in design mode a datagridview to my form. The datagridview has 2 columns, one column is textbox column, the other column is combobox column. I have figured out how to…
Jeanno
  • 2,769
  • 4
  • 23
  • 31
2
votes
3 answers

Setting default value to a DataGridViewComboBoxCell

The combobox displays a blank field by default even though the combobox is populated with a number of values ColumnSpeed.DataSource = speedList; ColumnSpeed.ValueType = typeof(string); I also tried the following, but it still displays the blank…
alhazen
  • 1,907
  • 3
  • 22
  • 43
2
votes
1 answer

Error trying to rebind DataSource to DataGridViewComboBoxCell?

I have a DataGridView with two DataGridViewComboBoxColumns. I want to use the selected item in the first column to trigger a re-population of the items in the second column, on a per-row basis. Here's the code I have so far. "addlInfoParentCat"…
John
  • 15,990
  • 10
  • 70
  • 110
2
votes
1 answer

Editing Combobox item in Datagridview in C#

I have a Datagridview in Winform. One of the column is a Combobox. Is it possible to set the property such that user can enter apart from being able to select the entries from the dropdown list. I was able to do it on a Combobox item with a…
Kiran
  • 8,034
  • 36
  • 110
  • 176
2
votes
1 answer

Combobox in vb.net datagridview not showing value first time

Following is my code: Public Class Form1 Private DT_LocalTransactionList As DataTable Private Sub DataGridView1_CellEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellEnter …
2
votes
1 answer

How to populate DataGridView with textbox and combobox with comboboxcells having different value lists

I have three columns , textbox, combobox and textbox in that order: this.columnLocalName = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.columnLocalAddress = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.columnLocalPort =…
2
votes
2 answers

Detect selection of the same item in a DataGridViewComboBoxCell

I have a datagridview with a datagridviewcomboboxcell in a C# winform application. I am easily able to capture when a new item is selected because the CellValueChanged event fires. However, I would like to be able to detect when the combobox is…
JonF
  • 2,336
  • 6
  • 38
  • 57
1 2
3
13 14