Results 1 to 3 of 3

Thread: How to know which items are selected in a multi-select ListBox

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2003
    Posts
    110

    How to know which items are selected in a multi-select ListBox

    I may have asked a simple question..
    but i m just not able to figure it out.

    Generally we provide the users with two listbox where the first one is a list of available and the other selected ones.

    I found a solution in JavaScript but i would like to have it thru ASP.Net Server Side coding only.

    pls suggest
    Anis Bombaywala

  2. #2
    Lively Member
    Join Date
    Oct 2002
    Location
    Los Angeles, CA
    Posts
    73
    Basically, you go "for each" loop through list items and each item should have property Selected

  3. #3
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    kind of like this
    VB Code:
    1. Dim item As ListItem
    2.  
    3. For each item in ListBox1.Items
    4.    If(item.Selected) Then
    5.       'do something with the selected item
    6.    End If
    7. Next
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width