VB-APP: How to determine rows of a child based on parent row selected.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nev
    Contributor
    • Oct 2007
    • 251

    VB-APP: How to determine rows of a child based on parent row selected.

    Good day Sirs & Madams, I know some of you will find this problem very simple. Kindly share a little knowledge to me on how to deal with this. Thank you.

    I have a parent-child table relation. when bsParent is navigated, bsChild follows. In code, I did this to determine the rowstate:
    Code:
    dim dtParent as datatable = ds.Parent.copy
    for i as integer to dtParent.defaultview.count - 1
    if dtParent.defaultview(i).row.rowstate = datarowstate.modified then
    'code to process
    else
    dim dtChild as datatable = ds.Child.copy
    [B]for j as integer to dtChild.defaultview.count - 1[/B]
    if dtChild.defaultview(j).row.rowstate = datarowstate.modified then
    'code to process
    end if
    next
    end if
    next
    If you notice the bold statement, what I am checking is the total child rows. I need to determine how to get only the child rows with respect to the parent row that is selected.

    Please help me kind Sirs & Madams. Thank you.
  • nev
    Contributor
    • Oct 2007
    • 251

    #2
    I tried:
    Code:
    dtChild.defaultview.rowfilter = bsChild.filter
    dtChild.defualtview.sort = bsChild.sort
    but it didn't work.

    Comment

    Working...