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

How do i programatically hide

6 Answers 309 Views
PageView
This is a migrated thread and some comments may be shown as answers.
Bahram Moinvaziri
Top achievements
Rank 1
Bahram Moinvaziri asked on 12 Aug 2010, 11:56 PM
hi,
I need to programatically hide the tab buttons but i can't find how to do this.
thanks,
Bahram

6 Answers, 1 is accepted

Sort by
0
Emanuel Varga
Top achievements
Rank 1
answered on 13 Aug 2010, 02:22 PM
Hello Bahram,

You can access the stripButtons functionality like this:

Snippet
((Telerik.WinControls.UI.RadPageViewStripElement)(this.radPageView1.GetChildAt(0))).StripButtons = Telerik.WinControls.UI.StripViewButtons.None;

You can use that enumeration to define which buttons you want to show.

Best Regards,
Emanuel Varga
0
Bahram Moinvaziri
Top achievements
Rank 1
answered on 13 Aug 2010, 07:03 PM
Actually this did not seem to do anything or at least what i needed. I figure it out.
I have to call this function on every index of the page to make the buttons invisible.

radPageViewMain.Pages[pageNumber].Item.Visibility = ElementVisibility.Hidden;
0
Bahram Moinvaziri
Top achievements
Rank 1
answered on 13 Aug 2010, 10:17 PM
After playing around with this, what i really wanted to do was to collapse the buttons and the strip are. So, here is how to do that:

(Telerik.WinControls.UI.RadPageViewStripElement dStrip = ((Telerik.WinControls.UI.RadPageViewStripElement)(this.radPageViewMainTab.GetChildAt(0)));
StripViewItemLayout dLayout = (StripViewItemLayout)dStrip.ItemContainer.ItemLayout;
dLayout.Visibility = ElementVisibility.Collapsed;
0
Stefan
Telerik team
answered on 18 Aug 2010, 09:16 AM
Hello everyone,

I am glad you found answer yourself. If you have any other questions, do not hesitate to contact us.
 
Regards,
Stefan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Joost
Top achievements
Rank 1
answered on 17 Nov 2010, 06:29 AM
This code hides the tab just fine. When I hide all tabs, the area the tabs were showing on is still there - how can we hide this also? Tweak the page height?
0
Stefan
Telerik team
answered on 19 Nov 2010, 04:24 PM
Hello Joost,

Thank you for writing.

The provided code snippet by Bahram Moinvaziri should work as expected when using our latest release:

RadPageViewStripElement dStrip = ((RadPageViewStripElement)(this.radPageView1.GetChildAt(0)));
StripViewItemLayout dLayout = (StripViewItemLayout)dStrip.ItemContainer.ItemLayout;
dLayout.Visibility = ElementVisibility.Collapsed;

Please make sure that you are setting the ElementVisibility property to Collapsed and not to Hidden, because this might cause the issue. 

If this does not work for you, please open a support ticket and provide us with your project so we can find the reason causing this behavior.

Looking forward to your reply.

Kind regards,
Stefan
the Telerik team
See What's New in RadControls for WinForms in Q3 2010 on Wednesday, November 17, 11am Eastern Time: Register here>>
Tags
PageView
Asked by
Bahram Moinvaziri
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Bahram Moinvaziri
Top achievements
Rank 1
Stefan
Telerik team
Joost
Top achievements
Rank 1
Share this question
or