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
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 -
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?
Mike
It makes sense, but I'm still getting an error message the way I'm doing it.
I get the second level record by
Dim ItemRow As UltraDataRowsCollection = dsOrder.Rows(rowSelected.Index).GetChildRows("bndLineItems")
So ItemRow should have the 3rd level records. But when I do
I get the error message
'Infragistics.Win.UltraWinDataSource.UltraDataRowsCollection.Private Function GetChildRows(row As Infragistics.Win.UltraWinDataSource.UltraDataRow, childBand As Infragistics.Win.UltraWinDataSource.UltraDataBand, allocateIfNecessary As Boolean) As Infragistics.Win.UltraWinDataSource.UltraDataRowsCollection' is not accessible in this context because it is 'Private'.
In fact, ItemRow doesn't even come up in IntelliSense with GetChildRows as a valid method.
What am I doing wrong?
BTW, thanks for your assistance.
ItemRow as you have it defined here is not an individual row, it's a collection of rows. You need to get a single row using the collection indexer.
Dim LocRow As UltraDataRowsCollection = ItemRow(0).GetChildRows("bndLocations")
Thanks. You were right on the money. I didn't see that error.
Golly, I wish I was as smart as you.
It's all pure luck, I assure you. ;)