473,320 Members | 2,000 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,320 software developers and data experts.

CheckedListBox - ValueMember

Hi!

I have a CheckedListBox, bound to a DataSet using
DisplayMember and ValueMember. I need to have the
ValueMember of all checked items in run time. the only
way to receive ValueMember is through the SelectedValue,
which is not useful in my situation.
what is the best way to have the collection of
ValueMembers, based on the collection of Checked items?

Thanks in advance,
Tonya.
Nov 15 '05 #1
1 5623
Iterate through the SelectedItems instead

int val;
foreach(DataRowView dr in listBox1.SelectedItems)
{
val = int.Parse(dr[ listBox1.ValueMember ]);
MessageBox.Show( this, "Value = " & val.ToString());
}

"Tonya" <an*******@discussions.microsoft.com> wrote in message
news:07****************************@phx.gbl...
Hi!

I have a CheckedListBox, bound to a DataSet using
DisplayMember and ValueMember. I need to have the
ValueMember of all checked items in run time. the only
way to receive ValueMember is through the SelectedValue,
which is not useful in my situation.
what is the best way to have the collection of
ValueMembers, based on the collection of Checked items?

Thanks in advance,
Tonya.

Nov 15 '05 #2

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

Similar topics

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...
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...
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...
1
by: engloon | last post by:
hi guys, below is the code i wrote. but it only return the first checked item even i have 2 items checked. please help on this problem. any help would be appreciated, thanks. Dim indexchecked...
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.