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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top