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

Showing a parent datamember on a child form

Status
Not open for further replies.

nells1

Programmer
Mar 17, 2003
28
CA
Hi All

I'm positive this has to be a very simple thing to do. I'm very new to vb.net and I'm having a bit of fun with binding at the moment.

Take the standard Customers/Contacts relationship. There is a form for each entity but on the contacts form I want to show the name of the customer. I want it to be a part of the Binding Context for the form so when the user chooses another contact, the Customer name is kept in sync.

The datasouce for my Binding context is a dataview of the Contacts table. I can quite happily bind to the Contact's children tables using the relationship name as a part of the binding statement ie:

Code:
Add New Binding("Text", ContactsDataView,"[RelationshipName].[ColumnName]")

I can't use the relationship from the child to get to the parent though, and I can't see any other way of binding to the parent (apart from catching the CurrentChanged event of the Binding Context, getting the parent, and then outputting the value onto the form - which is not ideal for me).

This seems like a truly basic task... I just can't seem to figure it out. Any help would be greatly appreciated!!!

Many thanks
Nells
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top