Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ComboBox, DataSource, DisplayMember and ValueMember
Message
 
To
01/11/2005 12:20:52
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01063988
Message ID:
01064102
Views:
22
Bonnie,
Yes I figured that out immediately after I figured out how to set DisplayMember and ValueMember for a DataView and you are right it is a lot easier to read.

Einar
>Einar,
>
>And as you may have figured out already, you can also just specify "ProductID" rather than oDT.Columns["ProductId"].ToString() when using a DataTable as your DataSource as well ... it's not just applicable to DataViews. In fact, I prefer it that way ... much easier to read. =)
>
>~~Bonnie
>
>
>
>>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
Reply
Map
View

Click here to load this message in the networking platform