Iterate through ArrayList using an another ArrayList

Discussion in 'ASP .Net' started by Saravanan Rathinavelu, Aug 16, 2003.

  1. Let's say there is an ArrayList(s) A and B.
    A has 1 column and 5 rows.
    B has 10 columns and 10 rows, where column1 on both being
    the same with additional rows in B.

    Using ArrayList A need to loop through B and pull only
    those exist on both ie., 5 rows out of B with 10 columns
    and assign it to an another ArrayList say C. Later i can
    use C to bind to a DataGrid as well as give an option to
    bind the complete B to the DataGrid.

    Could someone help me figuring out how to get this done.
    thanks
    -Saravanan.R-
     
    Saravanan Rathinavelu, Aug 16, 2003
    #1
    1. Advertisements

  2. Saravanan Rathinavelu

    Natty Gur Guest

    Hi,

    you can use BinarySearch with IComparer.

    Natty Gur, CTO
    Dao2Com Ltd.
    34th Elkalay st. Raanana
    Israel , 43000
    Phone Numbers:
    Office: +972-(0)9-7740261
    Fax: +972-(0)9-7740261
    Mobile: +972-(0)58-888377
     
    Natty Gur, Aug 17, 2003
    #2
    1. Advertisements

  3. please give me example of using BinarySearch with
    IComparer.
     
    Saravanan Rathinavelu, Aug 19, 2003
    #3
  4. Saravanan Rathinavelu

    Natty Gur Guest

    Natty Gur, Aug 19, 2003
    #4
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.