Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you bind data to a CheckedListBox

Status
Not open for further replies.

DoctorWho

MIS
Apr 28, 2003
13
US
(C# using VS.NET 2003)

I am trying to write a Windows Forms application and I have a form with a CheckedListBox control on it, which I want to bind a lookup table to and a resolution (data) table to.

My problem is I cannot find what properties I should use to bind the data to this control! In fact, it is even worse. According to Microsoft's online help for the CheckedListBox ("Creating a Lookup Table for a Windows Forms ComboxBox, ListBox, or CheckedListBox Control") you are supposed to use the DataSource, DisplayMember and ValueMember properties. However, while working with the control in the designer, I don't see any of those properties anywhere, and when trying to just assign the values directly to the properties in code, I don't get any confirmation from IntelliSense that I am using the correct properties.

If you check another Microsoft online help on, say the DisplayMember property, you get the following comment,

"This member supports the .NET Framework infrastructure and is not intended to be used directly from your code."

So, on the one hand Microsoft's online help tells you to use properties DataSource, DisplayMember and ValueMember. But on the other hand they tell you don't use them?!

So, I am really confused. I am supposed to use those properties; I am not supposed to use those properties; I am supposed to use those properties; I am not supposed to use those properties; ...

OK, if we can get away from the schizophrenic advise from Microsoft for a second, can someone PLEASE tell me what I am supposed to use, in order to bind the lookup data, and the "real" data, to the CheckedListBox control?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top