views:

856

answers:

1

How can I select a specific value in the combobox column in the datagridView using its index?

I.e. the comboboxColumn is already populated. I just need to set its selectedIndex to my choice (if it is possible).

+2  A: 

Hello,

suppose you have a dataGridView with 1 column (your comboboxColumn), and you want to set the cell(0, 0) value to index 2:

dataGridView1.Rows[0].Cells[0].Value = comboboxColumn.Items[2];
najmeddine