Samio

Samio

  • NA
  • 201
  • 176.5k

Comboboxcolumn at design time

May 16 2012 12:08 PM
I have set up a combobox column in a datagridview at runtime, it worked well (I could change or remove rows without any problem )but when I click at "+" button (Add) I get an error: "datagridviewcombocell is not a valid value".

Then I tried to set up the same column at design time, all the properties used previously in the code were entered in the Properties pane,

I wonder how to use datasource for this column, since it is related to a derived entity.

With code it is used like this:

DataSource = Entities.Customers.Execute(MergeOption.AppendOnly)

May be is there a similar instruction to be used in Form load event?

  NorthwindEntities nw;
  private void Form1_Load(object sender, EventArgs e)
  {
  nw = new NorthwindEntities();
  bindingSource1.DataSource = nw.Orders;
  datagridview1.columns["ComboCol"] .........  .dataSource = nw.Customers.Execute(MergeOption.AppendOnly) ???
  }

Thanks in advance.

Answers (4)