Unbound and Dynamic PageSize

2 posts, 0 answers
  1. Sean
    Sean avatar
    7 posts
    Member since:
    Oct 2012

    Posted 17 Nov 2016 Link to this post

    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?

  2. Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    570 posts

    Posted 22 Nov 2016 Link to this post

    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.
Back to Top