Check Parent-child relationship in datagrid

G

Grey

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

Elton Wang

Hi Grey,

You can use

parentRow.GetChildRows(relation).Length

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

HTH

Elton Wang
(e-mail address removed)
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top