im want put a DataGridViewComboBoxCell
in a specific column for any rows i have in my DataGridView
.
Now i have a problem... I would like to show a default value in that specific columns where i had put a DataGridViewComboBoxCell
, but there is nothing shown..
String[] options = new String[] {"On", "Off" };
for(int i = 0; i< rows.Count; i++)
{
// lets say one row looks like this {"1","On"}, {"2", "Off"}
MydataGridView.Rows.Add(rows[i]);
DataGridViewComboBoxCell MyComboBox= new DataGridViewComboBoxCell();
MyComboBox.Items.AddRange(options);
MydataGridView.Rows[i].Cells[1] = MyComboBox;
}
I would like to show my added rows as default, before I can select a {"On","Off"}
state via DataGridViewComboBoxCell
.
I hope it was clearly enough. :)