Master/Detail Binding with datagrids

E

erniej

as per instructions in the walkthrough, I have managed to
create a master/detail relationship between two datagrids.
However I have a requirement to apply this to three
datagrids and the third datagrid does not seem to reflect
the selected row on the second datagrid using this method.

The relevant lines of code are as follows.

' binding on master table
dgTables.SetDataBinding(CurrentViewDS,"ALL_TABLES")
' binding on first detail table using the relation
dgIndexes.SetDataBinding
(CurrentViewDS, "ALL_TABLES.ALL_TABLESINDEXES")
' up to here all works fine - the following however does
not seem to bind the third dataset
dgIndexColumns.SetDataBinding
(CurrentViewDS, "INDEXES.INDEXESINDEX_COLUMNS")

The three datatables are called ALL_TABLES, INDEXES and
INDEX_COLUMNS and the two relations are called
ALL_TABLESINDEXES and INDEXESINDEX_COLUMNS

Any ideas or alternative ways to accomplish this would be
much appreciated.

Cheers
 
O

One Handed Man

Hello

Lets see. Are you trying to produce the following.

Grid1 is a master to Grid2 and Grid2 is a master to Grid3, so Grids 2 and 3
are also Slaves, a kind of drill down excercise right ? . . .


If so, the easier way to do this without writing hardly any code is to set
up a relation between Grids1 and 2 and Then 2 and 3. Set the dataSource for
Grids 2 and 3 to the respective relations and bingo.


OHM
 
A

Armin Zingler

erniej said:
as per instructions in the walkthrough, I have managed to
create a master/detail relationship between two datagrids.
However I have a requirement to apply this to three
datagrids and the third datagrid does not seem to reflect
the selected row on the second datagrid using this method.

The relevant lines of code are as follows.

[Code}

Maybe you'll also get an answer at
microsoft.public.dotnet.framework.windowsforms.databinding
 
E

erniej

Thanks OHM

How do you set up relations between grids ? I have set up
relations between the respective tables and have used
grid.SetDataBinding to bind the relations to the grids
(grid.datasource did not work). As I mentioned before
this works fine for the first relation in the set but does
not update grid3 when the selection in grid2 changes.

Cheers
 
E

erniej

Thanks OHM,

How do you set up a relation between two grids? I have
set up a relation between table1 and table2 (relation1)
and another between table2 and table3 relation2. The
grid1 is bound to table1, grid2 to relation1 and grid 3 to
relation2. I have used grid.SetDataBinding to carry out
the bindings because grid.DataSource did not work.

This method gives the correct result in grid2 but grid3
does not change to reflect a changed selection in grid2.

Cheers

Erniej
 
E

erniej

Thanks
-----Original Message-----
erniej said:
as per instructions in the walkthrough, I have managed to
create a master/detail relationship between two datagrids.
However I have a requirement to apply this to three
datagrids and the third datagrid does not seem to reflect
the selected row on the second datagrid using this method.

The relevant lines of code are as follows.

[Code}

Maybe you'll also get an answer at
microsoft.public.dotnet.framework.windowsforms.databinding


--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top