Hide TabStrip when only one tab is open

2 posts, 0 answers
  1. Vinod
    Vinod avatar
    23 posts
    Member since:
    Nov 2011

    Posted 26 Jun 2013 Link to this post

    Is there a way to hide the TabStrip when only one tab is open?
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 01 Jul 2013 Link to this post

    Hello Vinod,

    This functionality is not supported out of the box. However, you can achieve your requirement by extracting the default ControlTemplate of the RadTabControl and customize it (read more). After extracting all the Styles and resources you can find the a RadDockPanel hosting an ItemsPresenter wrapped in a ScrollViewer control. That dock panel represents the TabStrip. You can bind its Visibility property to the Items property of the RadTabControl through a custom converter. In that converter you can check the items count of the collection that will be passed as the value parameter and return the corresponding Visibility.

    Furthermore, if you want to control the visibility of the TabStrip at run-time you can define a property in your View-Model and bind it in TwoWay mode to the same Visibility property of the RadDockPanel. For your convenience I implemented the described approach in the attached project.

    Please take a look ta it and let me know if it works for you.

    Regards,
    Pavel R. Pavlov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top