User (Old forums)MemberJune 3, 2008 at 7:28 pmPost count: 23064
I am trying to have a master grid linked with Detail grid, which further is liked to a another detail grid. nested grids.
But when i try to populate the datasets i am not able to link the master field with the detail fields. It shows all the records of detail dataset attached with each of the master records. Can you guide me what went wrong in my understanding. the code that i am trying is as below.Here below , I am trying to achieve master and detail releationship.Is the GridControl.Title a important property or that can be set anything ?
It raises a error as below.
5 – Child list for field imslocal cannot be created.
probably what i am missing is the relation or the key to link between the two data sets…. am new to ado.net, if any tips on this to link it with xceed grid conttol will be much helpful.
vb.net code ………………………
szMasterDS à My MASter Dataset , data for master grid
qry = select top 5 Cint(ss_id) as S_ID, [parent ssid] as PSSID from imslocal
szMasterdetailDS à My Detail Dataset, Data for Detail Grid.
qry = Select * from IMSCostCenter (there exists a field ss_id in this table)
For some reason , this is limited to MS Access.
‘ ad detail dataset to detail grid
Dim MasDetTemplate As New DetailGrid()
MasDetTemplate.Collapsed = True
szUSrCtrl.Title = “Master”
MasDetTemplate.Title = “Details”
szUSrCtrl.ScrollBars = Xceed.Grid.GridScrollBars.Both
m_spacerRow = New SpacerRow()
m_spacerRow.Height = 4
.DataRowTemplate.AutoHeightMode = AutoHeightMode.AllContent
.DataRowTemplate.FitHeightToEditors = True
Imported from legacy forums. Posted by Credits (had 2373 views)User (Old forums)MemberJune 5, 2008 at 3:48 pmPost count: 23064
Basically, this is a problem in the way you set the DataSource and the DataMember properties.
The best way to go is to set the same DataSource to all the grids and set the DataMember to the relationship name of each level of detail grids.
gridControl1.SetDataBindings( dataSet11, “Customers” );
DetailGrid dgrid1 = new DetailGrid();
DetailGrid dgrid2 = new DetailGrid();
gridControl1.DetailGridTemplates.Add( dgrid1 );
dgrid1.SetDataBindings( dataSet11, “Customers.Customers_Orders” );
dgrid1.DetailGridTemplates.Add( dgrid2 );
dgrid2.SetDataBindings( dataSet11, “Customers.Customers_Orders.Orders_OrderDetails” );
Imported from legacy forums. Posted by André (had 1708 views)User (Old forums)MemberJune 6, 2008 at 1:25 pmPost count: 23064
It works now ….I was missing on setting the relationship name at each levels.
Imported from legacy forums. Posted by Credits (had 680 views)User (Old forums)MemberAugust 17, 2008 at 8:11 pmPost count: 23064
I’m using the same logic to display the master detail data. But there’s an issue, it is taking too long(more than 3 minutes) to display the data. Actually, my master table have approximately 30k records and there are 30-40 detailed grids with 3 or 4 records on an average. When I debug the code masterGridControl.UpdateDetailGrids() is taking almost all the time. Is there any other way to optimise my code?? your advise is highly appreciated.
Following is my code…….
DetailGrid detGrid = new DetailGrid();
Imported from legacy forums. Posted by Ram (had 379 views)User (Old forums)MemberAugust 18, 2008 at 7:52 pmPost count: 23064
To clarify things, are you saying there are 30 to 40 DetailGrids for every master rows, or 30 to 40 DetailGrids for the whole master grid?
If you mean the first option, this means 2.7 million rows minimum ( 30k records X 30 DetailGrids X 3 detail rows ).
In this case, since the grid does not offer a virtual mode (loading data on the fly as needed), the only option you have is to implement your own data paging (that is, make your data source give only the rows you need to display, and request rows as needed), or use idle time in your application to load records into the DataSet, which means the grid will added them automatically, and eventually, all records will be loaded.
Imported from legacy forums. Posted by André (had 1178 views)
- You must be logged in to reply to this topic.