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

Hide TabStrip when only one tab is open

1 Answer 174 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Vinod
Top achievements
Rank 1
Vinod asked on 26 Jun 2013, 02:38 PM
Is there a way to hide the TabStrip when only one tab is open?

1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 01 Jul 2013, 12:00 PM
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 >>
Tags
TabControl
Asked by
Vinod
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or