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.
Loading
SamioPosted May 18, 2012, 12:18 PM
passed too many hours on this without success... Hmmm, it is disappointing.
VulpesPosted May 17, 2012, 3:50 PM
SamioPosted May 16, 2012, 3:01 PM
At design:
datagridview1 datasource is set to databindingsource1 which is set to MyNameSpace.Orders (Entity)
DataPropertyName is set to : CustomerID in Columns properties pane
At runtime:
bindingSource1 datasource is set to nw.Orders (Entity)
Please is there something missing ?
VulpesPosted May 16, 2012, 2:25 PM