How to populate combobox nested within dataGridView

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I've a column in a dataGridView set as combobox. I can't find any example
showing how to populate the list in the combobox. Does anyone have an example
showing me this.

Regards Jesper.
 
You can click the dataGridView in the designer and open the Columns
property. Select the column that you specified as a combo box and open the
Items property for that column. You can add your combo box items for this
column in here. You can accomplish the same thing through code:

DataGridViewComboBoxColumn myCol = dataGridView1.Columns[3];
myCol.Items.Add("1");
myCol.Items.Add("2");
myCol.Items.Add("3");

Adrian.
 
Back
Top