Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > What does it mean that CheckedListBox.DataSource is overloaded??!!!!
 

What does it mean that CheckedListBox.DataSource is overloaded??!!!!

The following documentation page:
http://msdn.microsoft.com/en-us/library/system.windows.forms.checkedlistbox.datasource%28it-it%29.aspx

states that DataSource is overloaded!!!
How can it be possible.
Moreover documentation states that CheckedListBox shouldn't be databound but if I declare
ListControl checkedList = new CheckedListBox();
I can see the DataSource property and it actually works (well it works even if the variable type is CheckedListBox itself).
What's the problem with CheckedListBox databinding or how should we implement it.
From google and msdn I could not find an actual answer.
ilmatte  Wednesday, September 09, 2009 2:18 PM

Hi,

CheckedListbox control inherits from ListBox. So it will get the parent properties. I test on my side. You can write the setting datasource code and this can be compiled even though the datasource property is not show in intelisense list.

checkedListBox1.DataSource = dt01;

checkedListBox1.DisplayMember = "col01";

checkedListBox1.ValueMember = "col02";

By the way, you can expend the base CheckedListBox control with the datasource property.

The following tells about that. Hope this helps.

http://www.codeproject.com/KB/combobox/ExCheckedListBox.aspx

Best regards,

Ling Wang


Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Wednesday, September 16, 2009 11:24 AM
Hi Ling,
Thank you for your kind answer.
Actually what I would like to know is why is DataSource hidden and why the documentation states that we should not use it.
Moreover it sounds strange to me hearing about property overloading in C# so I didn't understand why that article
defined the property as overloaded.
Could you explain me the meaning of these two things?

Thank you very much

Matteo Tontini
ilmatte  Friday, September 18, 2009 1:54 PM

You can use google to search for other answers

Custom Search

More Threads

• is there any new idea abt BindingList in linq
• Convert datagridview data to temp table
• Inserting a default value into a formview
• Gridview : Enable CommandField on selected rows only
• smooth pixel vertical scrolling
• DatagridView Crashes OnPaint. When stepping thru debugger can never be reproduced.
• GetCellBounds method
• ToolStripMenuItem question
• BindingSource.Find failed when binding to DataRelation Child table
• Row addition in DATA GRID: Where to update to Data Source?