SelectedPageChanging vs PageIndexChanging

3 posts, 0 answers
  1. Adam P
    Adam P avatar
    27 posts
    Member since:
    Jan 2014

    Posted 16 Aug 2014 Link to this post

    Hello, I just wanted to know if there is any difference between the SelectedPageChanging and PageIndexChanging events.  I can't think of a single scenario where one would be used but not the other. 

    Is there one that is suggested over the other? 

    Is one deprecated but not the other? 

    Thanks

    PS, see attached screenshot - looks like some API Documentation may need some updating...
  2. Adam P
    Adam P avatar
    27 posts
    Member since:
    Jan 2014

    Posted 16 Aug 2014 in reply to Adam P Link to this post

    One thing that's kind of annoying - SelectedPageChanging uses RadPageViewCancelEventArgs.  These eventargs have a Page and Cancel property. 

    Does the Page represent the page you're changing to or from?

    The documentation doesn't say at all.  In fact it's wrong and says it is fired after it's changed, but I believe it fires before it changes (when it's changing).

    http://www.telerik.com/help/winforms/e_telerik_wincontrols_ui_radpageview_selectedpagechanging.html

    PageIndexChanging uses RadPageViewIndexChangingEventArgs  which has CurrentIndex and NewIndex (plus this questionable "Page" property), two geniusly named properties that don't even require me to read the docs.  And if it did - at least the docs tell me my answer ... =)

    http://www.telerik.com/help/winforms/allmembers_t_telerik_wincontrols_ui_radpageviewindexchangingeventargs.html
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 19 Aug 2014 Link to this post

    Hello Adam,

    Thank you for writing.

    The SelectedPageChanging event will be fired, when the currently active page in RadPageView is being changed. For example when you click the tab of another page to activate it or when you set the SelectedPage property of the control. The Page in the event arguments will provide the page you are changing to. The currently selected page can be accessed via the SelectedPage property of the control.

    The PageIndexChaning event will be fired, when a page in the Pages collection changes its index. For example if you insert some page or swap pages. The CurrentIndex and the NewIndex will tell you which was the index the Page was, and which is the NewIndex the page will have.

    So these events cover different cases.

    Note taken about the API description. I have updated your Telerik Points for this report.

    I hope that this clear things up. Let me know if you have any additional questions regarding this matter.

    Regards,
    Stefan
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top