>Kelvin,
>Do you have an example of how I can do this. I tried to create another column in the datadridview using this template "DataGridViewComboBoxColumn". I specified the its properties as follow:
>
>DataPropertyName as ProductName
>DataSource as productsBindingSource
>DisplayMember as Name
>ValueMember as ProductID
>
>the column is still empty.
>
>Any Clue?
After adding a DataGridViewComboBoxColumn, set the column's DataPropertyName to ProductID.
In the constructor of the form, instantiate a Products business object (you need to create one if you are using the sample app) then after the call to InitializeComponent, make the following calls:
this.oProduct.GetAllData();
this.ProductColumn.DisplayMember = "ProductName";
this.ProductColumn.ValueMember = "ProductID";
this.ProductColumn.DataSource = this.oProduct.DataSet.Tables[0];
p.s. By the way, my name is "Kevin" <s>
Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com