Checkedlistbox issue


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Checkedlistbox issue

  1. #1
    Join Date
    Mar 2007
    Posts
    16

    Checkedlistbox issue

    Hi all,
    Well, I am having a problem trying to get the value from a checked item from a checkedlistbox. All I can get its the index but that's not what I want. What I am trying to do is to uncheck all the items that dont have the value = 0 once I click the item with that value and also vice-versa.
    Tanks in advance for the attention.

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Code:
    For Each item As String In lstChecked.CheckedItems
        ' item contains value
        Debug.Print(item)
    Next
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Mar 2007
    Posts
    16
    Oops, I am sorry. I forgot to say that the checkedlistbox is filled by a datatable like this:
    With checkedlistbox
    .DataSource = dvClasse
    .ValueMember = "Code"
    .DisplayMember = "Name"
    End With

  4. #4
    Join Date
    Jul 2004
    Posts
    365

    Smile CheckListBox.

    I think you need something like this:

    Dim x As Integer

    For x = 0 To CLB.Items.Count - 1
    If CLB.Items.Item(x).ToString = 0 Then
    CLB.SetItemChecked(x, False)
    End If
    Next

    This will loop through the checklistbox and un-selected all items where the value is 0. Hope this helps..



    jb

Similar Threads

  1. Deadlock issue in SQL Server
    By manumishra in forum Database
    Replies: 5
    Last Post: 06-09-2008, 04:28 PM
  2. Deployment project issue
    By jjvainav in forum .NET
    Replies: 0
    Last Post: 09-19-2005, 09:14 AM
  3. Re: Hailstorm and the Trust Issue - revised
    By VBWyrde in forum Security
    Replies: 0
    Last Post: 10-25-2001, 01:44 PM
  4. Replies: 0
    Last Post: 09-19-2001, 06:48 AM
  5. bizzare issue w/ cells - not in UP sim
    By Michael in forum Mobile
    Replies: 1
    Last Post: 07-11-2001, 05:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center