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

GridView paging doesn't work correctly when grouping

3 Answers 133 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ken
Top achievements
Rank 1
Ken asked on 03 Nov 2015, 11:49 AM

Hi,

I have the following code:

<telerik:RadGridView ItemsSource="{Binding PagedSource, ElementName=dataPager}"
                                 IsReadOnly="True"
                                 ShowGroupPanel="False"
                                 ShowColumnHeaders="False"
                                 RowIndicatorVisibility="Collapsed"
                                 AutoGenerateColumns="False"
                                 AutoExpandGroups="True">
 <telerik:RadGridView.GroupDescriptors>
     <telerik:GroupDescriptor Member="OwnerTypeDescription"/>
 </telerik:RadGridView.GroupDescriptors>
</telerik:RadGridView>
 
<telerik:RadDataPager x:Name="dataPager"
                      PageSize="{Binding RecordsPerListPage}"
                      Source="{Binding PagedCollection}"
                      DisplayMode="FirstLastPreviousNext"
                      IsTotalItemCountFixed="False"/>

The property RecordsPerList page returns 10, however the paging doesn't take this into account and 20+ records are still shown on a single page.

I noticed that this only happens if grouping is set for the gridview. If I remove the GroupDescriptor paging works properly and only 10 records per page are shown.

Any idea why this is happening?

Thanks!

3 Answers, 1 is accepted

Sort by
0
Ken
Top achievements
Rank 1
answered on 05 Nov 2015, 01:34 PM

This also seems to vary with the PageSize. In my example if I set RecordsPerListPage to 5, in the grouped list i get 12 entries per page, if I set it to 6 I get 13 and if I set it to 7 I get 16.

Ideas?

0
Petya
Telerik team
answered on 06 Nov 2015, 09:49 AM
Hello Adrian,

The behaviour you're observing is related to the fact that when RadGridView is grouped, the groups are pages and not the individual items. Could you have a look at the Paging Before Grouping example for RadGridView in our demos and check whether the approach suits your needs? 

I hope this helps. 
 
Regards,
Petya
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Ken
Top achievements
Rank 1
answered on 09 Nov 2015, 01:27 PM

Hi Petya,

Thanks for the answer! It seems to work perfectly.

Cheers,

Adrian

Tags
GridView
Asked by
Ken
Top achievements
Rank 1
Answers by
Ken
Top achievements
Rank 1
Petya
Telerik team
Share this question
or