473,378 Members | 1,138 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,378 software developers and data experts.

CheckListBox and value

How do I get the vaue of an item in the checklistbox control
My control is populated with a datasource and I assigned the DisplayMember
as well as the ValueMember
..clb_DataPicker.DataSource = myDatatable

..clb_DataPicker.DisplayMember = "CompanyName"

..clb_DataPicker.ValueMember = "Company_ID"

..clb_DataPicker.Refresh()

Dim s As String

For x As Integer = 0 To .clb_DataPicker.Items.Count - 1

'/////////////////////////////////

I got the Text right but I want the Value

'If .clb_DataPicker.GetItemChecked(x) Then s =
..clb_DataPicker.GetItemText(.clb_DataPicker.Items .Item(x))

Next
Nov 20 '05 #1
1 1787
Silly me What about if I was looking more in detail. May be too much coding
today
If .clb_DataPicker.GetItemChecked(x) Then s = .clb_DataPicker.SelectedValue

give me the result

Thanks to myself
"Nicolas" <nl*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
How do I get the vaue of an item in the checklistbox control
My control is populated with a datasource and I assigned the DisplayMember
as well as the ValueMember
.clb_DataPicker.DataSource = myDatatable

.clb_DataPicker.DisplayMember = "CompanyName"

.clb_DataPicker.ValueMember = "Company_ID"

.clb_DataPicker.Refresh()

Dim s As String

For x As Integer = 0 To .clb_DataPicker.Items.Count - 1

'/////////////////////////////////

I got the Text right but I want the Value

'If .clb_DataPicker.GetItemChecked(x) Then s =
.clb_DataPicker.GetItemText(.clb_DataPicker.Items. Item(x))

Next

Nov 20 '05 #2

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

Similar topics

5
by: Bernie Yaeger | last post by:
Is there any way to get a listbox or a checklistbox behave in an autocomplete manner, such that given 'two', 'three', 'water', 'them' would bring the selection to 'two' (not 'water') when I key in...
3
by: MikeY | last post by:
Hopefully someone can help me on this. I am using C#, making Windows forms. I have created a listView with checkbox's. I have enabled the checkboxes under the properties, and all the data,...
1
by: comic_rage | last post by:
Hi, I created a checkListBox to allow the user to select and place a check next to multiple items in the GUI. I would like to add a 2 column where the first column show the description of the...
2
by: Mike Kim | last post by:
hi all, i have a checklistbox populated with about 50 items from database. and on the same form, i added to button to do the following. if you click this button, i want to have all items in the...
16
by: MSN | last post by:
xp pro/vs 2002/web forms/VB How do I make a checkbox checked when add it to a checkboxlist. Thanks
0
by: Ville Mattila | last post by:
Dear readers, I've some problems with the data binding of the checklistbox control. I'm using it with user preferences that are stored in a XML File. Information from the file is fetched with...
1
by: Vidds | last post by:
Hi ALL, Can any one give me a solution to handle mouse over event of each of the Check Box Control in a CheckListBox Control. Thanks in advance Regards Vidds
1
by: obrienkev | last post by:
Hi, I want to mark the CheckListBox items as Checked based on a database query. So the CheckListBox items should be checked if each item matches fundsAffected field from the below query... ...
3
by: khalidjan9 | last post by:
I have data in an arraylist and i want to add data to checklist box on runtime and i also want to display a textbox besides it so that i get the comments example : checklistbox "text" textbox...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.