Master-Detail using Default Views?

D

Darwin S.

I asked this months ago and never got an answer and have
had several people email me since then asking me if I had
solved the problem. The only way I could do so was to
not use the master-detail in the datagrids but to use
DataViews and to set up a RowChanged event on the master
grid and programmatically create filters for the detail
grid. Is there no way for the master-detail relationship
to apply when using the default views?
 
D

Darwin. S.

Unless I'm missing something, that looks like a similar
kind of work around that I have used. What I am hoping
for is that is as straightforward of a solution as
setting a normal master-detail. Surely, one would expect
to be able to apply a filter to a dataset that is bound
to a datagrid and still have the master-detail
relationship work but so far that does not seem to be the
case.

Thanks,
Darwin
 
K

Kevin Yu [MSFT]

Hi Darwins,

It depends on how the database table is designed. Generally, many-to-many
relations are designed in three tables as the database in Roy's example. As
Roy said, there's no elegant way to bind the data directly. One solution is
provided by Roy. Or you can also join the "Courses" and "Registration"
table. However, this might cause some data redundancy.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

--------------------
| Content-Class: urn:content-classes:message
| From: "Darwin. S." <[email protected]>
| Sender: "Darwin. S." <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: Re: Master-Detail using Default Views?
| Date: Tue, 4 Nov 2003 18:03:08 -0800
| Lines: 41
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcOjQPWHHuz0F0imRjiCqw6ZkKWCIg==
| Newsgroups: microsoft.public.dotnet.framework.adonet
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:65433
| NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| Unless I'm missing something, that looks like a similar
| kind of work around that I have used. What I am hoping
| for is that is as straightforward of a solution as
| setting a normal master-detail. Surely, one would expect
| to be able to apply a filter to a dataset that is bound
| to a datagrid and still have the master-detail
| relationship work but so far that does not seem to be the
| case.
|
| Thanks,
| Darwin
|
|
| >-----Original Message-----
| >Yes there is. Look here (Lesson 4):
| >http://weblogs.asp.net/rosherove/story/9088.aspx
| >---
| >Regards,
| >
| >Roy Osherove
| >www.iserializable.com
| >
| >On Tue, 4 Nov 2003 16:21:03 -0800, "Darwin S."
| <[email protected]>
| >wrote:
| >
| >>I asked this months ago and never got an answer and
| have
| >>had several people email me since then asking me if I
| had
| >>solved the problem. The only way I could do so was to
| >>not use the master-detail in the datagrids but to use
| >>DataViews and to set up a RowChanged event on the
| master
| >>grid and programmatically create filters for the detail
| >>grid. Is there no way for the master-detail
| relationship
| >>to apply when using the default views?
| >
| >.
| >
|
 
D

Darwin S.

Yes, but this is a different issue from the many-to-many
relationship we discussed previously. This is strictly
about setting up the Master-Detail between two datagrids
but being unable to apply a filter to the master
datagrid. (BTW, I am working on a windows app, not and
asp.net app.) The problem that I have found is that it
is easy to set up a Master-Detail relationship when the
datagrids' sources are the tables but when you need to
set a filter, you can only do so on the DefaultView of
the DataSource's DataTable but that filter is not
reflected in the DataGrid unless you change the grid's
DataSource to the DefaultView. But then the Master-
Detail no longer works.

Darwin
 

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