472,791 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,791 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 4451

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: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.