Iterate through ArrayList using an another ArrayList

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Saravanan Rathinavelu

    Iterate through ArrayList using an another ArrayList

    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-
  • Natty Gur

    #2
    Re: Iterate through ArrayList using an another ArrayList

    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


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!

    Comment

    • Saravanan Rathinavelu

      #3
      Re: Iterate through ArrayList using an another ArrayList

      please give me example of using BinarySearch with
      IComparer.
      [color=blue]
      >-----Original Message-----
      >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
      >
      >
      >*** Sent via Developersdex http://www.developersdex.com[/color]
      ***[color=blue]
      >Don't just participate in USENET...get rewarded for it!
      >.
      >[/color]

      Comment

      • Saravanan Rathinavelu

        #4
        Re: Iterate through ArrayList using an another ArrayList

        please give me example of using BinarySearch with
        IComparer.
        [color=blue]
        >-----Original Message-----
        >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
        >
        >
        >*** Sent via Developersdex http://www.developersdex.com[/color]
        ***[color=blue]
        >Don't just participate in USENET...get rewarded for it!
        >.
        >[/color]

        Comment

        • Natty Gur

          #5
          Re: Iterate through ArrayList using an another ArrayList

          OK,



          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


          *** Sent via Developersdex http://www.developersdex.com ***
          Don't just participate in USENET...get rewarded for it!

          Comment

          • Natty Gur

            #6
            Re: Iterate through ArrayList using an another ArrayList

            OK,



            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


            *** Sent via Developersdex http://www.developersdex.com ***
            Don't just participate in USENET...get rewarded for it!

            Comment

            Working...