Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Related Information
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01165824
Message ID:
01166489
Views:
11
>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:
// Get a list of all Products
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
Previous
Reply
Map
View

Click here to load this message in the networking platform