Hi,
> Hello!
>
[quoted text clipped - 12 lines]
> how
> it works.
In NET2.0 it's more convenient if you put BindingSource's between them, so
it should look like:
MasterBindingSource
DataSource=someDataSet
DataMember="MasterTable"
ChildBindingSource
DataSource=someDataSet
DataMember="MasterTable.RelationToChildTable"
MasterDataGridView
DataSoure = MasterBindingSource
ChildDataGridView
DataSource = ChildBindingSource
> What I want: I click a row in the first datagridview, for instance with a
> primary key value set to 17.
[quoted text clipped - 4 lines]
>
> Shouldn't this be basic functionality, that not requires code???
Make sure you have a Data Source ( Typed DataSet + TableAdapters ).
Menu->Data->Show Data Sources, create a new Data Source for the two tables
if you haven't already. Then right click on the DataSet and choose open
'Edit DataSet with designer" and verify there is a relation between the two
DataTable (indicated by a line), if there isn't then right-click on the
empty space and choose add-relation.
Now inside Data Sources window you should see your two tables. The tables
have grids to the left of them while the fields have TextBox's on the left.
So you can either drag the master table to the Form or some of the master
table fields.
Then you should also see inside Data Sources window that the master table
has a field which also has a grid to the left (child table because of the
relation). Now you can also drag that child table on the Form or any of
it's field.
That should setup most things, except you still need to add some code to the
save button.
See also:
http://www.msdn.microsoft.com/vbasic/default.aspx?pull=/library/en-us/dnvs05/htm
l/newdtastvs05.asp
HTH,
Greetings
> Please help
> /Magnus
Bart Mermuys - 12 Jan 2006 23:32 GMT
[Snipped]
> In NET2.0 it's more convenient if you put BindingSource's between them, so
> it should look like:
[quoted text clipped - 6 lines]
> DataSource=someDataSet
> DataMember="MasterTable.RelationToChildTable"
Made a mistake with ChildBindingSource, should be:
ChildBindingSource
DataSource=MasterBindingSource
DataMember="RelationToChildTable"
> MasterDataGridView
> DataSoure = MasterBindingSource
>
> ChildDataGridView
> DataSource = ChildBindingSource
Greetings
>> What I want: I click a row in the first datagridview, for instance with a
>> primary key value set to 17.
[quoted text clipped - 35 lines]
>> Please help
>> /Magnus
Magnus,
> Shouldn't this be basic functionality, that not requires code???
Net is not the same as Office MS Access.
It gives you a lot rapid design tools to do the most standard things.
However as soon as we seen things as updating than we are allowed (have to
do) it ourselves.
I hope this helps,
Cor