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. Advertisements

  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. Advertisements

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:
    699
    davout
    Apr 18, 2004
  2. Bob Day

    Parent/Child Relationship

    Bob Day, Nov 5, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    263
    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:
    196
    steroche
    Aug 8, 2005
  4. Paul Vudmaska

    dbi: parent / child relationship

    Paul Vudmaska, Apr 15, 2004, in forum: Ruby
    Replies:
    1
    Views:
    170
    Kaspar Schiess
    Apr 15, 2004
  5. alexvts

    parent/child relationship question

    alexvts, Jul 25, 2003, in forum: Javascript
    Replies:
    0
    Views:
    132
    alexvts
    Jul 25, 2003
  6. Noel Dolan
    Replies:
    0
    Views:
    394
    Noel Dolan
    Jul 18, 2004
  7. Replies:
    4
    Views:
    248
    kaeli
    Mar 15, 2005
  8. Bitswapper
    Replies:
    5
    Views:
    418
    Prasad, Ramit
    Aug 27, 2013
Loading...