16
Answers

How to fill different ComboBoxes in a DataGridView control with C#?

Remco van Heck

Remco van Heck

12y
19.8k
1
I have a datagridview with 3 comboboxes.
When in combobox 1 (=Rownumber = 1) AA is selected then at runtime combobox2 has to be filed with some value. 
This value is comming from a DataTable.
When some value is selected in combobox2 (Also RowNumber = 1), then at runtime combobox3 (also RowNumber = 1) has to be filled with some value also comming from a DataTable.

Above means that when combobox1 where the columnindex is 0 has the value:
AA
BB
CC

When AA is selected ComboBox2 where the columnindex is 0 must have the value (ComboBox2 is must be filled at runtime and the values are comming from a DataTable):
11
22
33

When 11 is selected ComboBox3 where the columnindex is 0 must have the value (ComboBox3 is must be filled at runtime and the values are comming from a DataTable):
Name
LastName
Address
City

THEN THE NEXT ROW

At RowNumber 2 ComboBox1 has the value:
AA
BB
CC

when BB is selected, ComboBox2 also at RowNumber 2 must have the value (ComboBox2 is must be filled at runtime and the values are comming from a DataTable):
Pipo
Peppie
Clown

when Pipo is selected, ComboBox3 also at RowNumber 2 must have the value (ComboBox3 is must be filled at runtime and the values are comming from a DataTable):
Yes
No
Maybe

I have tried a lot but nothing works.
Is above possible and how in C#?
Answers (16)