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

Select pages via page Index

9 Answers 509 Views
PageView
This is a migrated thread and some comments may be shown as answers.
Alan
Top achievements
Rank 1
Alan asked on 21 Mar 2011, 05:51 AM
How do I select pages in a Pageview with the page index integer?

9 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 21 Mar 2011, 10:21 AM
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
0
Alan
Top achievements
Rank 1
answered on 21 Mar 2011, 06:26 PM
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
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 22 Mar 2011, 10:08 AM
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
0
Alan
Top achievements
Rank 1
answered on 22 Mar 2011, 06:56 PM
exactly what I needed.

Thanks

Alan
0
Richard Slade
Top achievements
Rank 2
answered on 22 Mar 2011, 09:04 PM
You're welcome. Please remember to mark as answer
Thanks
Richard
0
saud
Top achievements
Rank 1
answered on 21 Aug 2019, 05:15 AM

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.

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 21 Aug 2019, 08:20 AM
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.
0
saud
Top achievements
Rank 1
answered on 21 Aug 2019, 09:22 AM

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

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 21 Aug 2019, 09:59 AM
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.
Tags
PageView
Asked by
Alan
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Alan
Top achievements
Rank 1
saud
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or