Select pages via page Index

10 posts, 1 answers
  1. Alan
    Alan avatar
    14 posts
    Member since:
    Jan 2007

    Posted 21 Mar 2011 Link to this post

    How do I select pages in a Pageview with the page index integer?
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 21 Mar 2011 Link to this post

    Hello Alan,

    The way to select RadPageViewPages is not by index but by specifying the page itself. For example

    this.radPageView1.SelectedPage = this.radPageViewPage1

    Hope that helps, but please let me know if you need more information
    RIchard
  3. Alan
    Alan avatar
    14 posts
    Member since:
    Jan 2007

    Posted 21 Mar 2011 Link to this post

    Richard,

    I know how to do this, but it doesn't really help.

    Problem:
    1. How do I recursively go through 20 pages and set text, visibility?

    2. What if I rename pages based on other parameters.  
    For example 
    say I change radPageViewPage1 to radPageViewPageResults94952 based on a query result,
    or what if I name the pages
    radPage199, radpage22, radpageElephant.  

    How do I reference the 2nd page?  

    Do I now have to track changes I make to page names in order to reference them again?

    Why is there no ability to reference controls based on their Index?  Seems like a basic function.

    If we can't reference a page by the index why do we have the ability to get the page index
    intPageSelected = Me.radPageView.Pages.IndexOf(radPageView.SelectedPage) 

    Hope you can help.

    Alan
  4. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 22 Mar 2011 Link to this post

    Hello Alan,

    Another 2 ways to select a page would be as follows:

    Me.RadPageView1.SelectedPage = Me.RadPageView1.Pages(1) ' Index
    Me.RadPageView1.SelectedPage = Me.RadPageView1.Pages("RadPageViewPage2") 'Name

    Hope that helps
    Richard
  5. Alan
    Alan avatar
    14 posts
    Member since:
    Jan 2007

    Posted 22 Mar 2011 Link to this post

    exactly what I needed.

    Thanks

    Alan
  6. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 22 Mar 2011 Link to this post

    You're welcome. Please remember to mark as answer
    Thanks
    Richard
  7. saud
    saud avatar
    6 posts
    Member since:
    May 2019

    Posted 21 Aug 2019 in reply to Richard Slade Link to this post

    hi,

    i'd like to use this method => Me.RadPageView1.SelectedPage = Me.RadPageView1.Pages("RadPageViewPage2") 'Name

    but its not working for me. ERROR => Non-invocable member 'RadPageView.Pages' cannot be used like a method.

  8. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3727 posts

    Posted 21 Aug 2019 Link to this post

    Hello, Saud, 

    Following the provided information, I have prepared a sample project for your reference demonstrating how to get the desired RadPageViewPage by using its name via the Pages collection:

    Me.RadPageView1.SelectedPage = Me.RadPageView1.Pages("RadPageViewPage2")

    Everything seems to work as expected on my end with the latest version. Could you please give the provided project a try and see how it works on your end?

    I am looking forward to your reply.

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  9. saud
    saud avatar
    6 posts
    Member since:
    May 2019

    Posted 21 Aug 2019 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hey Dess,

    Thanks for the answer. It's working in the project attached. There might be something else triggering the error for me.

    Thanks anyways!

    Regards

    Saud

  10. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3727 posts

    Posted 21 Aug 2019 Link to this post

    Hello, Saud,  

    If you are still experiencing any problems with accessing the pages via page's name, I would recommend you to submit a support ticket from your account and provide a sample project demonstrating the error you are facing. Thus, we would be able to investigate the precise case and assist you further. 

    Alternatively, you can access the pages by index.

    Should you have further questions please let me know.

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top