Hello,
I'm having some trouble dealing with an hierarchical dataset.
In a dataset that has two records in the parent table, 20 records in the child table related to the 1st record and 5 related to the 2nd (where the datatable behind the child relation has a total of 25 records) how do I find out the row index of a child record?
So if I'm looking for the IDnum field of the 3rd child row, of the 2nd parent record I tried referrencing it like so:
dsData.Tables("parentTbl").Rows(1).Table.ChildRelations("relationname").ChildTable.Rows(iIntVar)!IDnum
iIntVar is an integer variable obtained from the MouseDown event in the DataGrid, when the user clicks on the 2nd Parent Record and drills down, clicking on that record's 3rd Child Row.
In this case iIntVar should be 2. In the above code sample my goal is to get the IDnum for what should be record number 22 in the datatable that makes up the child relation. It actually returns information for the record at index position 2 in that table.
Is there a way to directly referrence the data behind the relation as I'm trying to do? I know I could execute the GetChildRows event to build a Datarow array but don't want to do it this way (I feel there should be a better way).
Any assistance would be appreciated.
Oli
I'm having some trouble dealing with an hierarchical dataset.
In a dataset that has two records in the parent table, 20 records in the child table related to the 1st record and 5 related to the 2nd (where the datatable behind the child relation has a total of 25 records) how do I find out the row index of a child record?
So if I'm looking for the IDnum field of the 3rd child row, of the 2nd parent record I tried referrencing it like so:
dsData.Tables("parentTbl").Rows(1).Table.ChildRelations("relationname").ChildTable.Rows(iIntVar)!IDnum
iIntVar is an integer variable obtained from the MouseDown event in the DataGrid, when the user clicks on the 2nd Parent Record and drills down, clicking on that record's 3rd Child Row.
In this case iIntVar should be 2. In the above code sample my goal is to get the IDnum for what should be record number 22 in the datatable that makes up the child relation. It actually returns information for the record at index position 2 in that table.
Is there a way to directly referrence the data behind the relation as I'm trying to do? I know I could execute the GetChildRows event to build a Datarow array but don't want to do it this way (I feel there should be a better way).
Any assistance would be appreciated.
Oli