Hi ,
I have a requirement of Infinite paging,
Where I want both previous and next button to get navigate to last and first page respectively.
Navigating to first page on click of Next page button When user is on last page can be achieved by setting IsTotalItemCountFixed = false
But how to have previous page button navigate to the last page When User is on the First page of the Grid ?
Any assistance would be a great help :)
I have a requirement of Infinite paging,
Where I want both previous and next button to get navigate to last and first page respectively.
Navigating to first page on click of Next page button When user is on last page can be achieved by setting IsTotalItemCountFixed = false
But how to have previous page button navigate to the last page When User is on the First page of the Grid ?
Any assistance would be a great help :)
5 Answers, 1 is accepted
0
Hi,
RadDataPager uses a concrete implementation of the IPagedCollectionView interface as paged source. The default one is Telerik.Windows.Data.QueryableCollectionView. In this way, clicking the buttons invokes commands that call the MoveTo... methods. To override this behavior (e.x. move from first to last by invoking MoveToPrevious), you will need a custom implementation of IPagedCollectionView and ICollectionView, whch should be passed as RadDataPager.Source value.
Regards,
Ivan Ivanov
Telerik by Progress
RadDataPager uses a concrete implementation of the IPagedCollectionView interface as paged source. The default one is Telerik.Windows.Data.QueryableCollectionView. In this way, clicking the buttons invokes commands that call the MoveTo... methods. To override this behavior (e.x. move from first to last by invoking MoveToPrevious), you will need a custom implementation of IPagedCollectionView and ICollectionView, whch should be passed as RadDataPager.Source value.
Regards,
Ivan Ivanov
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Jai
Top achievements
Rank 1
answered on 06 Apr 2017, 04:59 AM
Hi Ivan,
Thank you for the quick response.
But We also need to enable the previous button of Raddatapager i.e. it should get clicked to execute the custom implementation of IPagedCollectionView and ICollectionView.
So basically our requirement is to enable the previous button of raddatapager to get clicked.
Any Tweak to solve this one will be grateful.
0
Hi,
The buttons invoke the MoveTo... methods and the buttons themselves get enabled in accordance to the results of the CanMoveTo properties. They are registered as read-only dependencies properties, so that they cannot be modified through the public API. Their implementation relies on IPagedCollectionView.CanChangePage. However, making it always return true will not be enough as they also rely of IPagedCollectionView.PageIndex. For instance CanMoveToFirstPage is calculated like this:
You can find the implementation of all the CanMoveTo... methods is our source code, in the DataPagerViewModel class.
Regards,
Ivan Ivanov
Telerik by Progress
The buttons invoke the MoveTo... methods and the buttons themselves get enabled in accordance to the results of the CanMoveTo properties. They are registered as read-only dependencies properties, so that they cannot be modified through the public API. Their implementation relies on IPagedCollectionView.CanChangePage. However, making it always return true will not be enough as they also rely of IPagedCollectionView.PageIndex. For instance CanMoveToFirstPage is calculated like this:
if (this.CanChangePage)
{
return this.PageIndex > 0;
}
return false;
Regards,
Ivan Ivanov
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Jai
Top achievements
Rank 1
answered on 09 May 2017, 10:53 AM
Hi Ivan,
It will be grateful If you can give an example for the above case where on click of previous button i can navigate to last page.
0
Hi,
I will try to prepare a sample project and I will post it here as soon as I have it.
Regards,
Ivan Ivanov
Telerik by Progress
I will try to prepare a sample project and I will post it here as soon as I have it.
Regards,
Ivan Ivanov
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.