RadGridView with RadDataPager not working as expected

0 Answers 85 Views
GridView
alex
Top achievements
Rank 2
Bronze
Iron
Iron
alex asked on 31 Jan 2023, 07:40 PM

Hello,

I followed your tutorial to use the RadDataPager and RadGridView. The pager is bound to the view model source items and the Rad Grid View is bound to the RadDataPager. See the following example:

 

<Grid x:Name="LayoutRoot" 
        Background="White">     
    <Grid.RowDefinitions> 
        <RowDefinition /> 
        <RowDefinition Height="Auto" /> 
    </Grid.RowDefinitions> 
    <telerik:RadGridView x:Name="radGridView" 
                         ItemsSource="{Binding PagedSource, ElementName=radDataPager}" 
                         AutoGenerateColumns="False"> 
        <telerik:RadGridView.Columns> 
            <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" /> 
            <telerik:GridViewDataColumn DataMemberBinding="{Binding CompanyName}" /> 
            <telerik:GridViewDataColumn DataMemberBinding="{Binding Title}" /> 
        </telerik:RadGridView.Columns> 
    </telerik:RadGridView> 
    <telerik:RadDataPager x:Name="radDataPager" 
                          Source="{Binding Employees}" 
                          PageSize="5" /> 
</Grid> 

 

I can see that the pager splits the items into pages of 50 items (I have 10 pages) but the RadGridView shows all the items. Only if I force the reload of the xaml (with Hot Reload), the RadGridView is updated according to the pager items in the current page, until that point all the items are shown.

What am I doing wrong?

Martin Ivanov
Telerik team
commented on 01 Feb 2023, 09:22 AM

I've tested your code, but couldn't reproduce the issue. The paging and the gridview work as expected. You can check this in the attached project.
alex
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 09 Feb 2023, 09:06 PM

Thank you martin.

I found some code in the attached property of my team that overrides the source items binding.

The control is working as expected.

Martin Ivanov
Telerik team
commented on 10 Feb 2023, 09:48 AM

I am glad to hear that you managed to resolve this.

No answers yet. Maybe you can help?

Tags
GridView
Asked by
alex
Top achievements
Rank 2
Bronze
Iron
Iron
Share this question
or