Check Parent-child relationship in datagrid

Discussion in 'ASP .Net Datagrid Control' started by Grey, Mar 18, 2005.

  1. Grey

    Grey Guest

    I have two data tables and forms the parent-child relation between them.
    However, not all parents have child row, In
    the datagrid, if the parent row has child records, the first image of will
    display "plus" picture , otherwise the image will
    change to "minus" picture to indicate no more drill down. My problem is how
    can I check the existence of child record
    for each parent and form the picture with either "plus" or "minus" properly.
     
    Grey, Mar 18, 2005
    #1
    1. Advertising

  2. Grey

    Elton Wang Guest

    Hi Grey,

    You can use

    parentRow.GetChildRows(relation).Length

    to determine if there are child rows (> 0: yes).

    HTH

    Elton Wang


    >-----Original Message-----
    >
    >
    >I have two data tables and forms the parent-child

    relation between them.
    >However, not all parents have child row, In
    >the datagrid, if the parent row has child records, the

    first image of will
    >display "plus" picture , otherwise the image will
    >change to "minus" picture to indicate no more drill down.

    My problem is how
    >can I check the existence of child record
    >for each parent and form the picture with either "plus"

    or "minus" properly.
    >
    >
    >
    >
    >.
    >
     
    Elton Wang, Mar 18, 2005
    #2
    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. davout
    Replies:
    0
    Views:
    553
    davout
    Apr 18, 2004
  2. Bob Day

    Parent/Child Relationship

    Bob Day, Nov 5, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    141
    Jacob Yang [MSFT]
    Nov 6, 2003
  3. steroche

    Datatgrid - Parent Child Relationship

    steroche, Aug 8, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    114
    steroche
    Aug 8, 2005
  4. Noel Dolan
    Replies:
    0
    Views:
    238
    Noel Dolan
    Jul 18, 2004
  5. Bitswapper
    Replies:
    5
    Views:
    150
    Prasad, Ramit
    Aug 27, 2013
Loading...

Share This Page