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 4 2290
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
"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
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
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Raphael Gluck |
last post by:
Hi Everyone
I am having some problems with a master detail page i have set up to
catalogue brochures from my site.
On my master page www.tripakltd.com/brochures.asp users are invited to
select...
|
by: Jim Bob |
last post by:
I Have a form with two datagrids bound to two tables in a dataset. The
top datagrid is a master and the one below it is a detail.
I want to be able to click on a row in the master and fire an...
|
by: Christopher Weaver |
last post by:
I'm having the hardest time doing the simplest thing.
I have a DataGrid bound to a table in a master detail DataRelation within a
DataSet
relTaskActivities = new DataRelation("TaskActivities",...
|
by: Marcel |
last post by:
Hi,
I'm new to VS and ASP.NET and have a question about
master/detail datagrids.
I have a master datagrid filled with data via a component
that contains a
SQL adapter. Now I would like to fill...
|
by: Gary Brower |
last post by:
Hi,
I am using VB.Net to create an ASP web form. My goal is to create a
master/detail web form that allows users to create new master and detail
records. For example the form would have header...
|
by: HS1 |
last post by:
Hello all
I followed the example in Visual Studio.net to create a master and detail
relationship as following:
two tables: Customers and Orders
two DataGrid: GridOrders and GridDetails...
|
by: sqlboy2000 |
last post by:
Hi,
I've just started playing around with master / detail pages and I'm trying
to simply change the detail page displayed in the contentplaceholder control
from code behind. I can't seem to find...
|
by: Sam |
last post by:
Attached I am sending 2 URL's from MSFT ASP.net Quick Start
Tutorial Web Site.
1) Run it URL:
http://www.asp.net/QuickStart/aspnet/samples/data/GridViewMasterDetai...
2) View Source URL:...
|
by: Mike Wilson |
last post by:
Dear group,
I have an invoice entry form, which is a simple Master fields / Detail grid.
The main summary information of the invoice are stored in one table in a
dataset, which is bound using a...
|
by: John |
last post by:
Hi
I am trying to create a master/detail form. I have my master and details
tables dragged onto the dataset. I have also dragged the fields from master
table on the form which has created the...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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...
|
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...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |