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

Master-details question

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.