[quoted text, click to view] "Freddy" <frosenbergNOSpam@globaltouchtelecom.com> wrote in message
news:%23VOela$iGHA.4504@TK2MSFTNGP03.phx.gbl...
> hi,
>
> i have two tables, related by a one to many relationship. i want a form
> with
> both tables showing, and when i click on a record in the 'one'
> datagridview,
> i want the 'many' view to show only the related records.
>
> i've been searching around and have created a relation between the two
> table
> adapters, but am not sure how to make the form behave the way i want. i
> would think this could be pretty automatic, so i am holding off writing
> code
> for click events until i hear if there is a better way. Can anyone
> provide some clues?
>
> (also...I would like the 'one' and 'many' views to each have a navigation
> menu strip.)
Briefly, I think the way to do this is:
- have a dataset with two tables and a data relation between the tables;
- have one BindingSource (parent binding source) with DataSource set to the
dataset and DataMember to the parent table;
- bind the parent grid and the parent BindingNavigator to this
BindingSource;
- have a second BindingSource with DataSource set to the parent binding
source and Datamember to the name of the data relation;
- bind the child grid and the child BindingNavigator to this BindingSource.
Chris Jobson