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

Problem with paging in hierarchical grid

1 Answer 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
eugen100
Top achievements
Rank 1
eugen100 asked on 22 Jun 2010, 10:57 AM

Hi Support,

I've been using the Radgrid component for some time now and have stumble into a problem I can't resolve.

I have a hierarchical grid which I want paging inside the details table. I've used a simple data binding in the server code:

RadGrid2.DataSource = DataTable1;

RadGrid2.MasterTableView.DetailTables[0].DataSource = DataTable2;

And simple relations in the aspx file:

                        <ParentTableRelation>

                            <telerik:GridRelationFields

                                            DetailKeyField="IDPerek"

                                            MasterKeyField="IDPerek" />

                        </ParentTableRelation>

 

 

The problem we are facing is that in the details table it seems that we have paging that is not in relation to a level but to the entire data source – so in each level we have the same number of pages although the number of records is different.
In the example below (see file attached) you can see the problem – the number in brackets show the actual number of records in each level:

Note: the characters are in Hebrew and the grid is right to left aligned.

Any help will be appreciated,
Evgeny

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 22 Jun 2010, 11:23 AM
Hello,

Instead of binding the grid conditionally using simple binding with DataBind() calls, you can transform your code to take advantage of the advanced binding with NeedDataSource handling and binding your grid instance to hierarchical data source through the DetailTableDataBind event of the control. Thus you will be able to utilize features like paging, grouping, filtering, custom edit forms which are supported only with this type of binding or declarative data sources.

I recommend that you examine the online demo below, which demonstrates how to achieve your goal:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/detailtabledatabind/defaultcs.aspx

Regards,
Pavlina
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
eugen100
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or