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
1
vote
1 answer

Feeding a override value from OnSelectionChangeCommitted DataGridViewComboBoxEditingControl to column object

So I have this and I know it is wrong: protected override void OnSelectionChangeCommitted(EventArgs e) { if (SelectedIndex == 0) { GENIO_Viewer.FullColourPaletteForm dlgColour = new GENIO_Viewer.FullColourPaletteForm(); …
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
1
vote
1 answer

Winform datagridview combobox EF mapping error

I am trying to make a picklist using the datagridview combobox, the list is dispalying properly but while selecting it is giving a type/casting error. It is giving string but expecting entity type MyProduct. Error Invalid cast from System.String to…
user3658516
  • 113
  • 11
1
vote
1 answer

Add Combobox in DataGridview

I am creating a Desktop Application and I have a grid named custCartGrid on my form. I want to select Transaction type like Sale or Return through combo-box in row in Grid. I am new to combo-boxes in Grid so I have not much idea that why I am not…
1
vote
1 answer

i want to build datagirdviewcomboboxcell dynamically

I want to build a DataGridView, which if I choose one of the item of a DataGridViewComboBoxCell, then the other cells in the same row which should be TextBoxes in other rows will turn into ComboBoxes,does anyone knows how to do that? It is…
1
vote
3 answers

Automatically create DataGridViewComboBoxCell from object's collection property

Using WinForms, I'm trying to write a method that checks if the data item bound to a row in a DataGridView contains an IList as a property and then automatically transforms the DataGridViewTextBoxCell into a DataGridViewComboBoxCell binding that…
1
vote
1 answer

Get selected index of `DataGridViewComboBox`

When you add a ComboBoxColumn in DataGridView, I do not know how to handle the change event of ComboBox. 'Adding To DGV data on form load Dim cmbovoce As New DataGridViewComboBoxColumn() cmbovoce.HeaderText = "Fruit" cmbovoce.Name =…
Mubby
  • 95
  • 1
  • 12
1
vote
1 answer

DataGridView custom ComboBox implementation error, sharing same value

Here is my code that i used to create my own custom combobox column, my combobox is kind of special that shows treeview inside (here is code page http://www.brad-smith.info/blog/projects/dropdown-controls). the new combobox column works well except…
1
vote
1 answer

Adding a datagridview cell on button click brings up error "Collection already belongs.."

I am dynamically adding a datagridview to a form. After the form is loaded, if the user wants to add a new row, I have a button with which the use can add one. On this button click I am trying to add a DataGridViewComboBoxCell: DataGridViewRow dtRow…
challengeAccepted
  • 7,106
  • 20
  • 74
  • 105
1
vote
0 answers

Clear and Add items to a DataGridViewComboBox but only for the selected row, not the entire column

There are couple of posts on DataGridViewComboBox but they don't cover this specific case. I have a DGV in a shoe billing form, and the first three columns are comboboxes. The first, for Model; second, for Color; third, for Number. Since I want…
1
vote
1 answer

How can I change the color of a DataGridViewComboBoxCell in the CellFormatting event?

private void CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if(whatever) e.CellStyle.BackColor = SystemColors.ControlDark; This works fine for text columns but for combo box columns it makes no difference. I'd just as…
Spike
  • 2,016
  • 12
  • 27
1
vote
1 answer

Which events are triggered by editing a DataGridViewComboBoxCell?

I'm trying to make a manually-editable DataGridView, not bound to any DataSource, where the DataGridView itself and most of the cell types are subclassed (custom cell types are provided as templates to columns in the grid subclass) so that certain…
MASQ
  • 135
  • 15
1
vote
1 answer

Replace Items DataGridViewComboBoxCell c#

I want to create a depend between two columns of each rows in the DataGridView. I add two columns (brands, models) runtime (select data from database). My goal is to load new items in models cell when brands cell changed. Fill the data: private…
Evgeny Gerbut
  • 390
  • 1
  • 4
  • 10
1
vote
0 answers

WinForms DataGridView set DataGridViewComboBoxCell value

I have a DataGridView with custom DataGridViewComboBoxCell columns, and I run the following code to initiaize it's cells to the initial value I want: try { …
alex440
  • 1,647
  • 3
  • 20
  • 35
1
vote
1 answer

SelectedIndexChanged event also firing for wrong datagridviewcomboboxcell

I have a datagridview which has 2 datagridviewcomboboxcolumns in it. I set the selectedindexchanged method via the editingcontrolshowing method (as this is how i've read it is supposed to be done?) However, for some reason, this event fires when…
1
vote
1 answer

Add datagridviewrow with mixed column types using addrange

I have a datagridview that gets populated with data from a database, the last two columns are a combobox and a button. To prevent flickering I use Rows.AddRange to add all the rows at once (the entire procedure is in a backgroundworker) My question…
Neo
  • 2,305
  • 4
  • 36
  • 70