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

Master/Detail question

P: n/a
Suppose I have a data entry screen with two strongly-typed datasets,
dsCustomers and dsOrders, as the master and child, respectively.

Because the two tables in the relationship are in two different datasets, I
don't think I can use the DataRelation object to link them. If not, what is
the best way to set up the master/detail relationship for the Windows form
for these two tables? Should I just use a filter on the child table and
manually update it everytime the parent row changes? What approach would be
the fastest?

TIA,

Mike Rodriguez
Nov 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Mike,

I would create a new typed dataset which has the parent and child table
in the same dataset with the DataRelation defined. Then, you can just bind
the child grid to the relation, and it will show the appropriate child
records automatically.

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

"Michael Rodriguez" <mi**@nospamforme.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Suppose I have a data entry screen with two strongly-typed datasets,
dsCustomers and dsOrders, as the master and child, respectively.

Because the two tables in the relationship are in two different datasets,
I don't think I can use the DataRelation object to link them. If not,
what is the best way to set up the master/detail relationship for the
Windows form for these two tables? Should I just use a filter on the
child table and manually update it everytime the parent row changes? What
approach would be the fastest?

TIA,

Mike Rodriguez

Nov 17 '05 #2

P: n/a
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:Ow**************@tk2msftngp13.phx.gbl...
Mike,

I would create a new typed dataset which has the parent and child table
in the same dataset with the DataRelation defined. Then, you can just
bind the child grid to the relation, and it will show the appropriate
child records automatically.


Hi Nicholas,

While that would certainly work, there are reasons why I want to keep the
two distinct typed datasets. Is there any way to define a relationship in
that scenario, or is my only option a row filter?

Thanks,

Mike
Nov 17 '05 #3

P: n/a
Michael,

In that case, no, there isn't. You would have to filter it yourself.

You might want to consider using the unified data set. You can always
copy the data from the two data sets into this data set. It seems like a
lot of extra code and work to replicate behavior that is already in the
framework.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Michael Rodriguez" <mi**@nospamforme.com> wrote in message
news:e$***************@TK2MSFTNGP15.phx.gbl...
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:Ow**************@tk2msftngp13.phx.gbl...
Mike,

I would create a new typed dataset which has the parent and child
table in the same dataset with the DataRelation defined. Then, you can
just bind the child grid to the relation, and it will show the
appropriate child records automatically.


Hi Nicholas,

While that would certainly work, there are reasons why I want to keep the
two distinct typed datasets. Is there any way to define a relationship in
that scenario, or is my only option a row filter?

Thanks,

Mike

Nov 17 '05 #4

P: n/a
Hi Nicholas,

After databinding the dataRelation to the childGrid, I would like to set the
allowNew = false so user can't add the row at the buttom of the childGrid.

However, there is no way to create a dataview for the dataRelation. In other
way, if I create a dataview with allowNew = false, then set the dataview to
be the childGrid datasource, the childGrid just can't change its row when
the currencymanager of the MasterGrid changes.

Is there any method to disallow the childGird add new rows?

Thank you.

Timothy
Feb 18 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.