When previously using the RibbonBar, setting HeaderVisibility="Collapsed" in the RibbonTab would hide the tab strip entirely. In the RibbonView, this functionality appears to be absent. Is there a workaround to get the same effect?
11 Answers, 1 is accepted
At the moment the Background property of the RadRibbonView controls the background behind the tabstrip. Please try setting it to Transparent and let me know if this is what you had in mind.
Kind regards,
Tina Stancheva
the Telerik team
The functionality I am hoping for is to actually collapse it, as was possible when using the RibbonBar.
Unfortunately the only way to do this is to change the RibbonView control template and in find the following code:
<
Grid.RowDefinitions
>
<
RowDefinition
MaxHeight
=
"28"
/>
<
RowDefinition
Height
=
"24"
/>
And the second Row is actually the Tab strip row, so you should change it for example to MaxHeight="24". That way if you set the HeaderVisibility to the tabs it should collapse the whole row. (also make sure you collapsed the ApplicationButton, Minimize and Help buttons).
On a side note I've created a work item to fix this in issue. All the best,
Miro Miroslavov
the Telerik team
Me and a coworker found the cause of the bug in the control template you referenced last night. For those without expression blend, a workaround in the code behind is:
Grid rootPanel = (Grid)ribbonView.Template.FindName("RootPanel", ribbonView);
rootPanel.RowDefinitions[1].Height = new System.Windows.GridLength(0);
A class level event handler may be viable to automate this for each instance though we haven't tested it.
For example, we opened up C:\Program Files (x86)\Telerik\RadControls for WPF Q3 2011 SP1\Themes\OfficeBlue\Themes\Office\Blue\RibbonView.xaml
I assume the version you are using has a different control template, but you can hopefully look at it and figure out how to address it for your version. The issue is, FindName will only work if the control (grid in this case) is actually given an x:Name. That's what FindName is looking for in the visual tree. You'll need to look to see if it has been named, and if so, to what. If this is the case you should be able to get this workaround going.
In the 2011 Q3 release, the main control template was the following (... represent skipping some XAML):
<!-- RibbonView --> <Style TargetType="telerikRibbonView:RadRibbonView"
....
<Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="telerikRibbonView:RadRibbonView"> <Grid x:Name="RootPanel"> <Grid.RowDefinitions> <RowDefinition MaxHeight="28" /> <RowDefinition Height="24" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions>
....
I attached a sample project demonstrating both approaches - editing the ControlTemplate of the RadRibbonView and accessing the RootPanel in code-behind. The application uses the 2011.3.1116.40 Telerik assemblies. Please note that in order to test the code-behind logic you'll need to remove the Style property of the RadRibbonView.
Give it a try on your side and let me know if it helps or if we can further assist you.
Kind regards,
Tina Stancheva
the Telerik team
HI
i wanna collapse my tab header of RibbonView. is there any workaround for this in addition to change the RibbonView style that describe above.
thanks
Hello,
The RadRibbonView control doesn't have a functionality to collapse the tabstrip (the tab headers). To achieve your requirement you still need to extract and modify the ControlTemplate of RadRibbonView or modify it in code behind.
Regards,
Martin Ivanov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.