Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1015
Accessing data from a second level child row
posted

I have a WinDataSource which has 2 levels of child bands.

1st band - order header information

2nd band - items being ordered

3rd band - warehouse locations for each item

I can access the data in the 2nd band by

Dim ItemRow As UltraDataRowsCollection = dsOrder.Rows(rowSelected.Index).GetChildRows("bndItems")

but I can't seem to figure out how to get the data in the 3rd band. Both of the following don't work

Dim LocRow As UltraDataRowsCollection = dsOrder.Rows(rowSelected.Index).GetChildRows("bndLocations")

Dim LocRow As UltraDataRowsCollection = ItemRow.GetChildRows("bndLocations")

What's the proper code for getting data from the lower level bands.

Thanks

Parents
No Data
Reply
  • 469350
    Offline posted

     Hi,

        It's basically the same. In order to get a row in the 2nd band, you have to start off with a row in the root band. You are doing this:

         dsOrder.Rows(rowSelected.Index)

        This returns you a root-level row. Then you call GetChildRows on it to get the collection of child rows under that particular row.

        The code you have here -

         Dim LocRow As UltraDataRowsCollection = dsOrder.Rows(rowSelected.Index).GetChildRows("bndLocations")

        doesn't work because you are once again starting off with a root-level row. But a root level row doesn't have any child rows in the 3rd band, it only has child rows from the second band. What you need to do is get an individual row in the second band and call GetChildRows on THAT row. 

        Make sense?  

Children