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

Visibility of pages and their location

9 Answers 300 Views
PageView
This is a migrated thread and some comments may be shown as answers.
Guy
Top achievements
Rank 1
Guy asked on 14 Oct 2010, 03:36 PM
Hi,

How would one go about programmatically setting the visibility of pages at run time and also is there a way to set the position of the pages along the rows? (i.e. can one page be set to the far right).

Kind regards,


Guy

9 Answers, 1 is accepted

Sort by
0
Emanuel Varga
Top achievements
Rank 1
answered on 14 Oct 2010, 04:02 PM
Hello,

I have prepared a short example, that should answer all of your questions:
var pageView = new RadPageView();

var page1 = new RadPageViewPage()
{
    Text = "Page1"
};
var page2 = new RadPageViewPage()
{
    Text = "Page2"
};
 
pageView.Pages.Add(page1);
pageView.Pages.Add(page2);
 
// to swap pages
pageView.Pages.Swap(page1, page2);
 
// to move page to another index
pageView.Pages.ChangeIndex(page1, newIndex);
 
// to move page to the last index
pageView.Pages.ChangeIndex(page1, pageView.Pages.Count - 1);
 
// to close it you have to remove it (sorry no other way that i could find)
pageView.Pages.Remove(page1);

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga
0
Guy
Top achievements
Rank 1
answered on 14 Oct 2010, 04:37 PM
Emanuel,

Thanks for taking the time out to responde, much appreciated.

Although your answer will be helpful for the future it unfortunately doesn't answer my question which I suspect is to do with my explanation, so i'll try to go a bit more indepth as to what i'm hoping to achieve.

With regards to the page position, what I would like to do is have a page which is alinged to the very right of the PageView whilst the others are still aligned to the left.

An example would be

|Page 1\ Page 2\ Page 3\                                                                Page 4\|
|--------------------------------------------------------------------------------------------|

If this cannot be achieved, how about a custom button added where the strip menu is? I'm looking to add as to see help button to my project.

Regarding the hidden pages, my users have to log in to the system and I don't want them to be able to view all the other tabs without logging in first. If I am unable to hide the other pages until a user has logged in, is there a way to block access to the pages until the log in has been complete?

Regards,

Guy

0
Emanuel Varga
Top achievements
Rank 1
answered on 14 Oct 2010, 04:53 PM
Hello again,

Sorry, first thing cannot be achieved in the current version, maybe they will add this functionality in the future.

For the second part, you can register to the SelectedPageChanging event and use e.Cancel = true; to cancel the the operation if the user is not logged in, for instance.

Best Regards,
Emanuel Varga
0
Emanuel Varga
Top achievements
Rank 1
answered on 14 Oct 2010, 05:00 PM
I forgot about the help button, by default you cannot do this, but if you really want to, i will try to find a way, by using a RadPageView inherited control.

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga
0
Guy
Top achievements
Rank 1
answered on 15 Oct 2010, 08:54 AM
Thanks again for both your replies.

I think i'm going to opt for a help button on the home page as it'll be easier.

I also believe your suggestion for the log in restrictions would be the cleaner way of doing things; could you perhaps expand on what you mean though as I'm pretty new to all this, sorry.

Many thanks,

Guy
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 15 Oct 2010, 09:00 AM
Hello again,

You should register to the SelectedPageChanging in the RadPageViewControl,

After that, inside that event you could do something like the following:
void pageView_SelectedPageChanging(object sender, RadPageViewCancelEventArgs e)
{
    if (!loggedIn)
    {
        // calling e.Cancel = true here, will cancel the changing of the page, thus the user will remain on the current page
        e.Cancel = true;
    }
}

Please let me know if this is OK for you and please don't hesitate to say so if you have any other questions.

Best Regards,
Emanuel Varga
0
Guy
Top achievements
Rank 1
answered on 16 Oct 2010, 05:27 PM
Hi,

Sorry for getting back to you late. That worked perfectly!

Thank you very much for your help.

Guy
0
Aggelos
Top achievements
Rank 1
answered on 31 Jul 2018, 09:01 PM

hello,

i would like to make pageview in which i have 3 button and each time user push it i load from my database a different datatable.How can i create each table with grid to open and hide it every time?

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 01 Aug 2018, 01:12 PM
Hello, Aggelos,    

You can add a RadGridView programmatically to the page when you click the button. I have prepared a sample project for your reference demonstrating how to fill a dummy DataTable and bind the grid to it. 

I hope this information helps. 

Regards,
Dess
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
Guy
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Guy
Top achievements
Rank 1
Aggelos
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or