Parent/Child/"Grandchild" rows

B

Bill Greenley

I have three grids: call them parent, child and grandchild. I can get the
CreateChildView to work just fine from parent to child. ParentRowView based
on SelectedIndex of underlying datamember of parent row. However, how does
this work when a row in child grid is selected in order to do a
CreateChildView for the next level and show the "grandchild" rows in the 3rd
grid? tia
 
B

Bill Greenley

in SelectedIndexChanged of parent grid....

Dim ParentView As New DataView(DsParentHistory.Tables("Parents"))
iCurrentRowIndex = dgParentHistory.SelectedIndex + (dgParentHistory.CurrentPageIndex * dgParentHistory.PageSize)
Dim currentRowView As DataRowView = ParentView(iCurrentRowIndex)
dgChildren.DataMember = ""
dgChildren.DataSource = currentRowView.CreateChildView("Parents2Children")
dgChildren.DataBind()

I don't know what to use for the underlined line of code in the corresponding sub for SelectedIndexChanged in the child grid to populate the dgGrandChildren datagrid via the relation Children2Grandchildren





You want to create a relationship based on both related columns. Look
at the overload method of DataRelation method that you are currently
using.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top