This is a migrated thread and some comments may be shown as answers.

radgrid hierarchy paging issue

1 Answer 113 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Osmon
Top achievements
Rank 1
Osmon asked on 19 Aug 2010, 04:53 PM
Hi,
       I have a grid declarative hierarchy model. 3 level depth (order, detail, items) The grid shows data correctly so the keys are mapped fine. Issue is paging. Attached is the screen shots.
So, what i figure out its showing is a total for the whole layer instead of just the record. Page Size of 5 is set on the grid tag ( i tried it on each gridview but it did not work properly)
Grid1.jpg
The english language has 2 subrecord each having 3 records. So, originally it was showing me 5 of 6 ; showing 3 records from 1st and 2 records from 2nd sub titles. it is misleading. As each has only 3 records so total is not correct (why do the total for all the records ?)
Both having a paging 1 and 2 link at the bottom.
i added few more records and the 2nd layer records totals to 10 now. So, its showing 10 on each record with paging links, although many of them have no records on the 2nd page obviously.

Grid2.jpg
The first subrecord does not show any record on first page but do show the record on the 2nd page.(both subrecords have 1 item each)

So, summary is that its doing total on the layer basis instead of for each record sub child count.

Finally, the data binding is in the needdatasource using linq

grid.datasource = EntitySet<Orders>

grid.MasterTableView.DetailTables[0].DataSource = IEnumerable<detailOrder>

 

grid.MasterTableView.DetailTables[0].DetailTables[0].DataSource = IEnumerable<Items>;


Any ideas ?

Thanks,

Osman


1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 24 Aug 2010, 11:14 AM
Hello Osmon,

The problem is in the detail table binding approach. You should not bind detail tables in this way in RadGrid's NeedDataSource event. You should use RadGrid's DetailTableDatabind event to bind each hierarchical table. This event is fired for every GridTableView that needs to rebind, so you need to pass e.DetailTable.DataSource the filtered collection of data items that need to be shown in the current detail table. You can recognize the detail tables at various levels in the hierarchy through their Name property. For a live demo on how to use the DetailTableDataBind event, please refer to the following QSF example.


Regards,
Veli
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Osmon
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or