473,785 Members | 2,459 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Checked List Box Help

Rob
I am doing something wrong...

I am populating a Checked List box from a stored proc...

CheckedListBox1 .DataSource=dsS tates.Tables("S tates")
CheckedListBox1 .DisplayMember = "State"
CheckedListBox1 .DisplayMember = "State"
"State" is the column in the table...

And the above works fine... All the states are shown in the CheckedListBox
I then want to loop thru to find the ones that were checked (process is
invoked from a button)...

Dim i as integer

For i=0 to CheckedListBox1 .Items.Count -1
If CheckedListBox1 .GetItemChecked (i)= true then
Msgbox ("Checked: " & CheckedListBox1 .GetItemText(i) )
End if
Next

The above code will give me the integer associated with the row number, but
how do I return the value of the rows contents (i.e., FL) ?







Jul 12 '06 #1
3 1160
For Each Item As Object In CheckedListBox1 .CheckedItems
MsgBox(CheckedL istBox1.GetItem Text(Item))
Next

Jul 12 '06 #2
For Each Item As Object In CheckedListBox1 .CheckedItems
MsgBox(CheckedL istBox1.GetItem Text(Item))
Next

Jul 12 '06 #3
Rob
Thank you very much !
"c_shah" <sh*********@ne tzero.netwrote in message
news:11******** **************@ 35g2000cwc.goog legroups.com...
For Each Item As Object In CheckedListBox1 .CheckedItems
MsgBox(CheckedL istBox1.GetItem Text(Item))
Next

Jul 12 '06 #4

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

Similar topics

26
2824
by: Simon Jefferies | last post by:
Hello, I am trying to add an item to a checked list box, like: clbList.Items.add("Hello",true) I get an error back: Run-time exception thrown: System.ArgumentOutOfRangeException - Specified argument was out of the range of valid values. Parameter name: '-1' is not a
0
306
by: adam | last post by:
A simple solution would be to have them double click a name in the list and just add the selected item to a seperate textbox, doing anything DB related in the double click event. >-----Original Message----- >Hello, > >I am having some trouble getting a checked list box to >behave the way i would like. Here is my situation. I >would like to load up a dynamic list of phone numbers.
2
1596
by: rishabhshrivastava | last post by:
Hi All, I am using CallBack feature in ASP.NET 2.0 and I am running into a problem with checkboxlist control. I have to find out which checkboxes are checked and get their values at client-side(using JavaScript) but always I get a value "undefined"....this code works for all other controls except checkboxlist and radiobuttonlist controls. I am pasting my code below Please let me know wht am i doing wrong.
2
2320
by: Aaron Reimann | last post by:
I have a lot of check boxes. This is an update of the check boxes, I want something was checked, then to do an insert (which is currently working), if something is no longer checked...delete the checkbox join/link that is in the database. So, the insert/checked is working, but the "unchecking" is not working. I don't know how to compare an array of what was not checked. Here is my code: if (is_array($_POST)) {
1
2013
by: sherifffruitfly | last post by:
Hi, I've got a checked list box, and a "go' button on the form. Each item in the checked list box is associated with a program (say notepad, calc, etc.). When the user clicks "go", every item that is checked is to be run. I'm looking for an elegant and extensible way to do this. I'm currently using an if block, which just seems silly to me. Structurally, it's the equivalent of the below. Any ideas on alternatives would be much
4
34076
by: Annie | last post by:
hello guys, I am having a DataGridView control. The first column is a checkbox column. The users can select the checkbox column. I need to loop through the grid rows and get the checked checkboxes and the rows numbers
2
7137
by: saurabhnsit2002 | last post by:
Can anyone help me about how to create combo box with its items as checked boxes or radio buttons. This has to be done in C#. I have seen something similar to this named custom combo boxes but they are in MFC I have to remain constrained only in C#. I have tried to add checked listbox in combobox drop down list but it is showing in text format i.e. name of the control added, if I change display property of combobox with some property of...
0
4102
by: cyberdawg999 | last post by:
Greetings all in ASP land I have overcome one obstacle that took me 2 weeks to overcome and I did it!!!!! I am so elated!! thank you to all who invested their time and energy towards helping me with my problems. Now for my new little problem,I had a problem posting the values from checkbox fields to a database and thats the obstacle I overcame. Now the second part is my new problem is that I want that the next time that page loads for...
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6739
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.