473,386 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Data Relation Advice

I have a DataSet with two tables and a DataRelation. When I populate the
DataSet and define a master detail relationship through the DataRelation,
the grid bound to the master table shows both the master and detail rows
while the grid bound to the detail table shows the detail rows for all of
the master table rows. I would like the grid bound to the detail table to
show the detail rows related to the each master row as the user moves
through the master rows. I know I could do this with a currency manager and
an event hander, but that doesn't seem right. Surely I'm overlooking
something fairly simple that makes this work.

Thanks.
Nov 17 '05 #1
2 1819
Christopher,

Instead of binding the details table to the child table, bind it to the
relation itself, and it should do what you want.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Christopher Weaver" <we*****@nospamverizon.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I have a DataSet with two tables and a DataRelation. When I populate the
DataSet and define a master detail relationship through the DataRelation,
the grid bound to the master table shows both the master and detail rows
while the grid bound to the detail table shows the detail rows for all of
the master table rows. I would like the grid bound to the detail table to
show the detail rows related to the each master row as the user moves
through the master rows. I know I could do this with a currency manager
and an event hander, but that doesn't seem right. Surely I'm overlooking
something fairly simple that makes this work.

Thanks.

Nov 17 '05 #2
Do you mean binding the details DataGrid to the DataRelation? The compiler
coughs that up. I've tried setting the DataSource property to
DataRelation.ChildTable, but that gives me the same result.

Also, when you 'binding', is this the same as setting the DataSource
property? I've tried that and I've also tried using
SetDataBinding(DataRelation, StringTableName) and SetDataBinding(DataSet,
StringTableName). The first one fails altogether ("Cannot produce a child
list for field <TableName>") while the second compiles and runs but produces
all of the child rows for the rows present in the parent table.

Thanks for any help.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:uQ**************@TK2MSFTNGP10.phx.gbl...
Christopher,

Instead of binding the details table to the child table, bind it to the
relation itself, and it should do what you want.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Christopher Weaver" <we*****@nospamverizon.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I have a DataSet with two tables and a DataRelation. When I populate the
DataSet and define a master detail relationship through the DataRelation,
the grid bound to the master table shows both the master and detail rows
while the grid bound to the detail table shows the detail rows for all of
the master table rows. I would like the grid bound to the detail table to
show the detail rows related to the each master row as the user moves
through the master rows. I know I could do this with a currency manager
and an event hander, but that doesn't seem right. Surely I'm overlooking
something fairly simple that makes this work.

Thanks.


Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Matthias S. | last post by:
Hi, I have to write an application which extensively uses an SQL Database. For a simple example say I have the following tables with the appropriate fields. 1. Company (ID, Name,...
14
by: Sharon | last post by:
I have two tables in the DataSet, the first present rooms and the other furniture kinds. Furniture kind, like chare, can be in more then one room. And specific room can contain more then one...
11
by: Thomas A | last post by:
Hi, I fill a datgrid with data from a xml document, it works fine But.... Now I will to filter the data to the grid so only the data shows from the criteria that I set. My code now is very...
5
by: sutphinwb | last post by:
Hi - This could be a simple question. When I relate two tables in a datasetet, how do I get that relation to show up in a GridView? The only way I've done it, is to create a separate table in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.