how to know all of index of selected item on web listbox control

Discussion in 'ASP .Net Web Controls' started by haiwen, Jul 11, 2003.

  1. haiwen

    haiwen Guest

    Hi, everyone:

    Is there some way to know all of the index number of all
    selected item in a multi-selection list web control.

    Sincerely,

    haiwen
    haiwen, Jul 11, 2003
    #1
    1. Advertising

  2. Hi haiwen,

    You need to iterate through the ListItemCollection collection, exposed by
    the Items property and check the Selected property for each ListItem.

    --
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET
    Looking for insights on ASP.NET? Read my blog:
    http://obies.com/vga/blog.aspx

    To contact me remove 'NOSPAM'. Please post all questions to the newsgroup

    and not by private mail.
    "haiwen" <> wrote in message
    news:024b01c347e2$5899a0b0$...
    > Hi, everyone:
    >
    > Is there some way to know all of the index number of all
    > selected item in a multi-selection list web control.
    >
    > Sincerely,
    >
    > haiwen
    Victor Garcia Aprea [MVP], Jul 12, 2003
    #2
    1. Advertising

  3. haiwen

    haiwen fu Guest

    hi, thanks for your reply, but it seems we can get all of the indexs by
    the SelectedIndices[] of the listbox. for web form, even I iterate
    through the listitem collection and get the selected item by checking
    its selected property. this selected item doesn't have index property. I
    can't find the way to get the index of these items even I know they are
    selected on Web Form. could you give me some code.

    Thank you so much

    Haiwen


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    haiwen fu, Jul 14, 2003
    #3
  4. haiwen

    haiwen Guest

    Hi, Thank you for your reply,
    But even after I iterate through the ListItem and get all
    the selected items, it seems the item doesn't have any
    property to know its index at the ListBox on Web Form. on
    Window Form, we can get them by SelectedIndices[].

    Could you give me some code to show how to do it.

    Sincerely,

    haiwen

    >-----Original Message-----
    >Hi haiwen,
    >
    >You need to iterate through the ListItemCollection

    collection, exposed by
    >the Items property and check the Selected property for

    each ListItem.
    >
    >--
    >Victor Garcia Aprea
    >Microsoft MVP | ASP.NET
    >Looking for insights on ASP.NET? Read my blog:
    >http://obies.com/vga/blog.aspx
    >
    >To contact me remove 'NOSPAM'. Please post all questions

    to the newsgroup
    >
    >and not by private mail.
    >"haiwen" <> wrote in message
    >news:024b01c347e2$5899a0b0$...
    >> Hi, everyone:
    >>
    >> Is there some way to know all of the index number of all
    >> selected item in a multi-selection list web control.
    >>
    >> Sincerely,
    >>
    >> haiwen

    >
    >
    >.
    >
    haiwen, Jul 14, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?S2FyZW4gR3J1YmU=?=

    How to change the color of the selected item in a web listbox cont

    =?Utf-8?B?S2FyZW4gR3J1YmU=?=, Jun 25, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    928
    Eliyahu Goldin
    Jun 26, 2005
  2. Iain
    Replies:
    3
    Views:
    927
  3. K B
    Replies:
    2
    Views:
    664
  4. Replies:
    0
    Views:
    300
  5. mldardy
    Replies:
    0
    Views:
    961
    mldardy
    Sep 28, 2010
Loading...

Share This Page