473,396 Members | 1,789 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,396 software developers and data experts.

Master-details question

HS1
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
--------------
Dim myDataRelation As DataRelation

myDataRelation = New DataRelation (
"CustomerOrder",dataSet.Table("Customers).Columns( "CustomerID"),
ds.Tables("Orders").Columns("CustomerID"))
dataSet.Relations.Add(myDataRelation)
GridOrders.SetDataBindings(dataSet, "Customers")
GridDetails.SetDataBindings(dataSet, "Customers.CustomerOrder")
----------------------------------

The code work OK.When I click on a sign (+) in a record in a Master Grid
(GridOrders), I can see a lower link "CustomerOder ". then when I click in
that link, the "Detail" of that record will be shown in the Detail Grid.

Do you know a way so that when I click on the (+) sign, the Detail Grid will
show details of the record (that means I don't have to click to the link any
more- I don't need this link- similarly to Form and Subform in Microsoft
Access)

Many thanks
S.Hoa

Nov 21 '05 #1
2 1264
Hi,

If you are already showing the detail records in a second grid why
not set the datagrids allownavigation property to false so the + doesnt show
up at all.

Ken
--------------
"HS1" <so*@slingshot.co.nz> wrote in message
news:1096451952.312414@ftpsrv1...
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
--------------
Dim myDataRelation As DataRelation

myDataRelation = New DataRelation (
"CustomerOrder",dataSet.Table("Customers).Columns( "CustomerID"),
ds.Tables("Orders").Columns("CustomerID"))
dataSet.Relations.Add(myDataRelation)
GridOrders.SetDataBindings(dataSet, "Customers")
GridDetails.SetDataBindings(dataSet, "Customers.CustomerOrder")
----------------------------------

The code work OK.When I click on a sign (+) in a record in a Master Grid
(GridOrders), I can see a lower link "CustomerOder ". then when I click in
that link, the "Detail" of that record will be shown in the Detail Grid.

Do you know a way so that when I click on the (+) sign, the Detail Grid will
show details of the record (that means I don't have to click to the link any
more- I don't need this link- similarly to Form and Subform in Microsoft
Access)

Many thanks
S.Hoa


Nov 21 '05 #2
Thanks
However, if I do that, I can not see the detail records anymore.
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:Oq**************@TK2MSFTNGP14.phx.gbl...
Hi,

If you are already showing the detail records in a second grid why
not set the datagrids allownavigation property to false so the + doesnt show up at all.

Ken
--------------
"HS1" <so*@slingshot.co.nz> wrote in message
news:1096451952.312414@ftpsrv1...
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
--------------
Dim myDataRelation As DataRelation

myDataRelation = New DataRelation (
"CustomerOrder",dataSet.Table("Customers).Columns( "CustomerID"),
ds.Tables("Orders").Columns("CustomerID"))
dataSet.Relations.Add(myDataRelation)
GridOrders.SetDataBindings(dataSet, "Customers")
GridDetails.SetDataBindings(dataSet, "Customers.CustomerOrder")
----------------------------------

The code work OK.When I click on a sign (+) in a record in a Master Grid
(GridOrders), I can see a lower link "CustomerOder ". then when I click in
that link, the "Detail" of that record will be shown in the Detail Grid.

Do you know a way so that when I click on the (+) sign, the Detail Grid will show details of the record (that means I don't have to click to the link any more- I don't need this link- similarly to Form and Subform in Microsoft
Access)

Many thanks
S.Hoa

Nov 21 '05 #3

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

Similar topics

0
by: webhosting | last post by:
After a failure, we promoted a slave to master. This included renaming the server to the old master's name and ip address, but leaving the server id alone. The new master works fine. We...
5
by: Michael Herman \(Parallelspace\) | last post by:
1. What are some compelling solutions for using Master/Content pages with Web Pages? 2. If a content area has a web part zone with web parts, what is the user experience like when "editting" the...
4
by: Steve Franks | last post by:
I have this cool nested master page scenario working great. However what is the correct way to be able to access a strongly typed property at the top level master from a content page that has a...
2
by: Jon Spivey | last post by:
Hi, Using VS 2005/VB.net. I need to add a meta description tag and change a stylesheet link from a page based on a master page. Found this article...
3
by: ivanpais | last post by:
Hi, I have a Web User Control, Lets say "Foo.ascx", that contains a button "btnFoo". I have a Master Page "Bar.master", that has a label "lblBar". This label is exposed by a public property...
17
by: Rob R. Ainscough | last post by:
Again another simple concept that appears NOT to be intuitive or I'm just stupid. I've read the WROX book and the example doesn't actually show how the .master page links in the other content...
2
by: SR | last post by:
I have started a web site using ASP.NET 2.0. I would like to centralize all of my classes in a StyleSheet but I cannot figure out how to link the StyleSheet to a Content Page since there is no...
7
by: Just Me | last post by:
Hi I have a master page with a control on it, but I need to set a property of that control from the content. my master page is called Admin.Master and the class is Admin. I have tried this
6
by: =?Utf-8?B?SmF5IFBvbmR5?= | last post by:
I am trying to access a Public property on a Master Page from a Base Page. On the content pages I have the MasterType Directive set up as follows: <%@ MasterType virtualpath="~/Master.master" %>...
5
by: =?Utf-8?B?bXVzb3NkZXY=?= | last post by:
Hi guys I'm trying to make my code as streamlined as possible, and add CSS file references dynamically when they are required, for example, if a page contains a webcontrol, then the related CSS...
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: 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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.