Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ComboBox, DataSource, DisplayMember and ValueMember
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01063988
Message ID:
01063993
Views:
15
Just like I thought it was a very simple question (I must try to think about coding instead of watching SWIII later today).
this.cboProduct.DataSource = this.oDV;
this.cboProduct.DisplayMember = "Name";
this.cboProduct.ValueMember = "ProductId";
Einar

>Probably just another simple question. I use the following code to populate a ComboBox (oDT is a DataTable):
>
>this.cboProduct.DataSource = oDT;
>this.cboProduct.DisplayMember = oDT.Columns["Name"].ToString();
>this.cboProduct.ValueMember = oDT.Columns["ProductId"].ToString();
>
>
>Earlier this morning I got this crazy idea to use a DataView to populate the ComboBox, but I can't seem to figure out how to set the DisplayMember and ValueMember when the DataSource is a DataView.
>
>Any assistance would be appreciated.
>
>Einar
Semper ubi sub ubi.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform