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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i show a child relation in a datagrid

Status
Not open for further replies.

Blitz

Technical User
Jul 7, 2000
171
US
I have a strongly typed dataset where each row from table 1 has many records in table 2. I have all the fields from table 1 bound to textboxes on my form. How can I have a datagrid on my form only display the records from table 2 that are related to the current row(current position of the binding manager) of table 1?

I know i can create a dataview and filter it each time the current row changes but i think there should be a better way than this.
 
Well kinda, that example is not using a strongly typed dataset, i cannot figure out how to reference the relation that already exists in my typed dataset.

Me.dataGrid2.DataSource = parentTable
Me.dataGrid2.DataMember = "ParentToChild"

for my problem it would be


Me.dataGrid2.DataSource = dsdataset.table1
Me.dataGrid2.DataMember = 'not sure how to reference relation

the relation name is "relation1"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top