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

accessing the dataset relations

Status
Not open for further replies.

DaZZleD

Programmer
Oct 21, 2003
886
US
I have a dataset with alot of relations defined and a datagrid that displays a table from within the dataset and the user can navigate from a table to another through the dataset's relations. However, what I can't seem to be able to do is to get the relation's parameters (e.g if I have two tables Orders(OrderID, ClientID) and Clients(ClientID,...), related by ClientID, and I display the Orders table, when I navigate to the Clients table I want to know what ClientID is being displayed)

thank you.
 
As usual, 10 minutes later I got the answer: (in the Navigate event)
Code:
((DataRowView)dataGrid1.BindingContext[dataSet1, dataGrid1.DataMember].Current).Row
and from here on, use [] to get the needed value.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top