Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have a datagrid with combobox columns in it. So whenever i change the value of a particular combobox the value disappears.

Below is the piece of code that i have used to create a datagridcomboboxcell to populate.

Thanks in advance.

What I have tried:

C#
DataGridViewComboBoxCell ComboBoxCell2 = new DataGridViewComboBoxCell();
                           ComboBoxCell2.DataSource = filteredOptions;
                           ComboBoxCell2.DisplayMember = ComboboxColumn.DisplayMember;
                           ComboBoxCell2.ValueMember = ComboboxColumn.ValueMember;
                           ComboBoxCell2.FlatStyle = FlatStyle.Flat;
                           ComboBoxCell2.DropDownWidth = 250;//shreyasimportant
                           this.gdbgGrid[Columnindex, gdbgGrid.CurrentCell.RowIndex] = ComboBoxCell2;
                           ComboBoxCell2.DisplayStyle = DataGridViewComboBoxDisplayStyle.DropDownButton;
Posted
Comments
Sunasara Imdadhusen 15-Mar-17 9:11am    
Can you please provide aspx code as well? also provide code snippet of page_load.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900