473,386 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

CheckedListBox: DisplayMember not working?

Does the CheckedListBox support DisplayMember/ValueMember?

I have been trying to use these properties with the CheckedListBox and they
are not working. I see from Google that databinding is not supported on
this control. Ok, fine. I tried to work around this by using
DictionaryEntries, which still didn't work (see code below). Now I see in
VS Help that DM/VM are not even listed as properties of the CheckedListBox
(they are in VS intellisense, though. argh!).

My guess is what I am trying to do is not supported with the CheckedListBox.
But the CLB is the right visual presentation for what I want. Is there a
way to make the CheckedListBox work in a DM/VM fashion, or some other well-
functioning alternative to the CLB?

Thanks for any advice,
Matt
Protected Overridable Sub InitCheckedListBox(ByRef clb As
CheckedListBox, ByVal dv As DataView, ByVal DispColumn As String, ByVal
ValColumn As String)

Dim de As DictionaryEntry

clb.Items.Clear()

clb.DisplayMember = "Key"
clb.ValueMember = "Value"

For Each drv As DataRowView In dv
de = New DictionaryEntry(drv(DispColumn), drv(ValColumn))
clb.Items.Add(de)
Next

End Sub
Jul 21 '05 #1
0 4511

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Aamir | last post by:
What is the straightforward way to get the checked contents of a CheckedListBox. I have a method that is supposed to return the csv string value out of CheckedItemCollection. But I don't kow how...
1
by: Chibi | last post by:
Hello! I'm back again with another problem. First of all, thank you to Jacob for helping me understand a bit more about NNTP commands. So now the problem: I have a collection of...
2
by: Andla Rand | last post by:
Hi, I have created a windows application in CSharp that is using a web browser control. When i did some coding to handle a chat window an exception was thrown with the following message: "COM...
4
by: Matthew | last post by:
Hi, I am using a checkedlistbox on a windows form and binding it to a collection of classes. clbAliases is the checkedlistbox control selectedplace is a class with property placealiases.This...
3
by: Steve Cutting | last post by:
Hi all, I have a CheckedListBox on one pane of a TabControl on a form. I find that whenever the user clicks a different tab then comes back, any checks that were in the list have disappeared. ...
9
by: Capt_Ron | last post by:
Hello, I would like to set the value of the item in the checked list box. I have a datareader that has 2 columns. PK and TEXT I want the TEXT as the Item and the PK as the Value. I can not...
0
by: Matt C. | last post by:
Does the CheckedListBox support DisplayMember/ValueMember? I have been trying to use these properties with the CheckedListBox and they are not working. I see from Google that databinding is not...
2
by: bh | last post by:
In the Listbox, there are properties for DisplayMember and ValueMember, just like the combobox, however, those properties are not present for the CheckedListBox. Does this mean that the only...
6
by: painkiller | last post by:
language: vb.net environment: windows forms .net : v1.1 i am having a checkedlistbox control that display document category such as text, image, video, audio etc. these values are coming from...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.