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

Unbound and Dynamic PageSize

1 Answer 122 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 1
Sean asked on 17 Nov 2016, 09:56 PM
Following the example here: http://docs.telerik.com/devtools/wpf/controls/raddatapager/how-to/change-page-size-dynamically

but on an unbound DataPager.

The two way binding of the combo box to the PageSize seems to work, as the number of pages is changed to reflect the selected value.  However, there is no event that allows me to set the items on the grid view, which is normally done in the PageIndexChanged event handler.

Currently, I am adding a SelectionChanged event handler to the combo box from which I call the same implementation as in the DataPager's PageIndexChanged handler, but this seems like it should be unnecessary.

Am I missing something?

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 22 Nov 2016, 11:56 AM
Hello Sean,

As its name suggests, the PageIndexChanged event is fired when RadDataPager's current page index is updated. Thus, it should get fired if changing the page size results in a change of the current page's index. This will, however, not be the case if you are at the first page of RadDataPager as no matter how your PageSize changes, the page index will remain 0. If you need to modify this behavior, you can handle the RadComboBox's SelectionChanged event, as you have already done.

I hope that this answers your questions. If you're not satisfied with this approach, please provide more information about your exact requirements and I will gladly assist you further.

Regards,
Dilyan Traykov
Telerik by Progress
Telerik UI for WPF is ready for Visual Studio 2017 RC! Learn more.
Tags
DataPager
Asked by
Sean
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or