Remove Items from List Box

Discussion in 'ASP .Net' started by Lit, Jul 27, 2007.

  1. Lit

    Lit Guest

    Hi,

    what is the best way of removing multiple items from a list box found in
    another list box.

    Foreach does not allow you to modify itself

    Looping through has index issues.

    Other than copying to new instance what gives?

    thanks,

    Lit
     
    Lit, Jul 27, 2007
    #1
    1. Advertising

  2. Lit

    Scott M. Guest

    Inline...


    "Lit" <> wrote in message
    news:upw0aJ%...
    > Hi,
    >
    > what is the best way of removing multiple items from a list box found in
    > another list box.
    >
    > Foreach does not allow you to modify itself


    Why not?

    > Looping through has index issues.


    Only that you have to use 2 indexes.

    > Other than copying to new instance what gives?


    Nothing, it just sounds like you don't want to do what is needed.
     
    Scott M., Jul 27, 2007
    #2
    1. Advertising

  3. Lit

    Lit Guest

    Hi Scott,

    You don't understand at all, or have no clue what the problem is.
    Try a foreach and delete from the collection itself. It does not work.

    It looks like the selected item approach will do it

    thank you for your time

    Lit



    "Scott M." <> wrote in message
    news:ub$kbo%...
    > Inline...
    >
    >
    > "Lit" <> wrote in message
    > news:upw0aJ%...
    >> Hi,
    >>
    >> what is the best way of removing multiple items from a list box found in
    >> another list box.
    >>
    >> Foreach does not allow you to modify itself

    >
    > Why not?
    >
    >> Looping through has index issues.

    >
    > Only that you have to use 2 indexes.
    >
    >> Other than copying to new instance what gives?

    >
    > Nothing, it just sounds like you don't want to do what is needed.
    >
     
    Lit, Jul 27, 2007
    #3
    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. Scott324
    Replies:
    3
    Views:
    4,503
    Jason Kester
    Oct 27, 2005
  2. mc
    Replies:
    5
    Views:
    1,696
    Walter Wang [MSFT]
    Jun 26, 2006
  3. Anjan Bhowmik
    Replies:
    1
    Views:
    481
    Misbah Arefin
    Feb 14, 2008
  4. mldardy
    Replies:
    1
    Views:
    754
    mldardy
    Dec 10, 2008
  5. Sara

    how to remove multiple items from the list box

    Sara, Aug 10, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    121
    Donald Welker
    Aug 10, 2005
Loading...

Share This Page