Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding row position of childtable record.

Status
Not open for further replies.

olichap

Programmer
Mar 20, 2001
389
US
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
 
Never mind, I found a way to return the actual row behind the hierarchical dataset instead of just the row index of the child relationship.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top