By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,856 Members | 1,986 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,856 IT Pros & Developers. It's quick & easy.

Master/Detail Binding with datagrids

P: n/a
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


Nov 20 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
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
erniej wrote:
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

Nov 20 '05 #2

P: n/a
"erniej" <an*******@discussions.microsoft.com> schrieb
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.dat abinding
--
Armin

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

Nov 20 '05 #3

P: n/a
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

-----Original Message-----
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 3are also Slaves, a kind of drill down excercise right ? . . .

If so, the easier way to do this without writing hardly any code is to setup a relation between Grids1 and 2 and Then 2 and 3. Set the dataSource forGrids 2 and 3 to the respective relations and bingo.
OHM
erniej wrote:
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

.

Nov 20 '05 #4

P: n/a
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
-----Original Message-----
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 3are also Slaves, a kind of drill down excercise right ? . . .

If so, the easier way to do this without writing hardly any code is to setup a relation between Grids1 and 2 and Then 2 and 3. Set the dataSource forGrids 2 and 3 to the respective relations and bingo.
OHM
erniej wrote:
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

.

Nov 20 '05 #5

P: n/a
Thanks
-----Original Message-----
"erniej" <an*******@discussions.microsoft.com> schrieb
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.da tabinding
--
Armin

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

.

Nov 20 '05 #6

P: n/a
Post me your code and I will try and find the solution for you.

OHM

erniej wrote:
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
-----Original Message-----
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
erniej wrote:
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

.

Nov 20 '05 #7

P: n/a
Thanks for the offer OHM

Have just found the solution & successfully tested it.

http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q882q
Item 5.78

It seems the trick is to set the datasource for each grid
to the parent table and then datamember for grid 2 to
ParentChild relation and datamember for grid 3 to
ChildGrandChild relation.

Cheers

-----Original Message-----
Post me your code and I will try and find the solution for you.
OHM

erniej wrote:
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
-----Original Message-----
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
erniej wrote:
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
.

.

Nov 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.