How do i programatically hide

7 posts, 0 answers
  1. Bahram Moinvaziri
    Bahram Moinvaziri avatar
    10 posts
    Member since:
    Oct 2008

    Posted 12 Aug 2010 Link to this post

    hi,
    I need to programatically hide the tab buttons but i can't find how to do this.
    thanks,
    Bahram
  2. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 13 Aug 2010 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Bahram Moinvaziri
    Bahram Moinvaziri avatar
    10 posts
    Member since:
    Oct 2008

    Posted 13 Aug 2010 Link to this post

    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;
  5. Bahram Moinvaziri
    Bahram Moinvaziri avatar
    10 posts
    Member since:
    Oct 2008

    Posted 13 Aug 2010 Link to this post

    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;
  6. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 18 Aug 2010 Link to this post

    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
  7. Joost
    Joost avatar
    1 posts
    Member since:
    Nov 2010

    Posted 17 Nov 2010 Link to this post

    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?
  8. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 19 Nov 2010 Link to this post

    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>>
Back to Top
UI for WinForms is Visual Studio 2017 Ready