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

Radgrid paging based on groups

3 Answers 156 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kelly
Top achievements
Rank 1
Kelly asked on 19 May 2014, 02:21 PM
Hi,
We are not able to implement paging on the basis of groups. For example we have 5 groups and have 10 rows in each group then if we set page size to 4 then first 4 groups should be displayed and 5th group should be displayed on 2nd page. But what happens is that only 4 rows of Ist group is displayed and 12 page numbers were created.

We have to implement paging based on groups while it is happening based on total records in the groups.

Please help. Its urgent.

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 20 May 2014, 10:18 AM
Hi Kelly,

Grouping is actually applied only on the items rendered on the current page, so collapsing a group cannot get the items from another page (in grouped view). To implement this would mean that the grid will require full datasource in order to be able to group items that are not in the current page,  which contradicts the base design of the control. The idea of the grid is to show data from your database, and if you do custom paging and send to the grid only X items, you can not expect the grid to group on X+Y items. If it is suitable for you can use the RadPivotGrid which design allows to group before paging, as it is made to support DataSources that also can do this.

Regards,
Pavlina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Kelly
Top achievements
Rank 1
answered on 21 May 2014, 04:19 AM
Our issue is not in collapsing or grouping the items. Issue is with implementation of paging when grouping is used.

It seems that I am not able to explain my question. Let me rephrase it:
For example: Items are grouped based on date and its getting displayed perfectly fine.
Now we have set page size to 5. 
There are 5 groups having 10 rows in each group. This means we have total of 50 data items (5 group X 10 rows) 
What we see in radgrid paging it shows Items 1 to 5 of 50 and 10 page numbers are displayed. It has done paging based on total records i.e. 50 not on number of groups i.e, 5
but we need that paging should display only 1 page and written as Items 1 to 5 of 1






0
Pavlina
Telerik team
answered on 26 May 2014, 08:46 AM
Hi Kelly,

I am afraid that due to the current implementation of the RadGrid control this functionality could not be implemented. Please excuse us for the inconvenience caused.

In general you can set RadGrid PageSize to whatever value you need. However in current page the RadGrid will show only page size GridDataItems regardless whether grouping is applied or not. If you need to set PageSize to the number of the groups you should manually calculate the groups that will be formed.


Regards,
Pavlina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Kelly
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Kelly
Top achievements
Rank 1
Share this question
or