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

Hide/Collapse tab strip in RibbonView

11 Answers 492 Views
RibbonView and RibbonWindow
This is a migrated thread and some comments may be shown as answers.
Hugh
Top achievements
Rank 1
Hugh asked on 09 Feb 2012, 07:42 PM
Is there a way to hide the RibbonTab strip when contained within a RibbonView?

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

Sort by
0
Tina Stancheva
Telerik team
answered on 10 Feb 2012, 03:21 PM
Hi Hugh,

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
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Hugh
Top achievements
Rank 1
answered on 10 Feb 2012, 05:25 PM
While that does make the tab bar invisible, it still ends up occupying the same amount of space.

The functionality I am hoping for is to actually collapse it, as was possible when using the RibbonBar.
0
Hugh
Top achievements
Rank 1
answered on 13 Feb 2012, 07:32 PM
Is there no way to do this?
0
Accepted
Miro Miroslavov
Telerik team
answered on 15 Feb 2012, 05:33 PM
Hello,

 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
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Hugh
Top achievements
Rank 1
answered on 15 Feb 2012, 05:59 PM
Thank you for creating a work item to correct this.

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.
0
Mike
Top achievements
Rank 1
answered on 23 Feb 2012, 06:13 PM
Are there any other work arounds for this? I am encountering the same issue but Hugh's workaround does not work for me. RootPanel is never found, so trying to set the height throws an exception. I'm using release 2011.3.1116.40 and do not have Expression Blend. Thanks.
0
Hugh
Top achievements
Rank 1
answered on 23 Feb 2012, 07:57 PM
The way we were able to find it was to look at the control template from one of the themes.

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>


.... 

0
Tina Stancheva
Telerik team
answered on 28 Feb 2012, 03:05 PM
Hello Mike,

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
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Mike
Top achievements
Rank 1
answered on 28 Feb 2012, 05:34 PM
Thanks very much for the help, Hugh and Tina, the workaround functions fine for me.
0
b
Top achievements
Rank 1
answered on 25 Jan 2021, 12:03 PM

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

0
Martin Ivanov
Telerik team
answered on 28 Jan 2021, 11:31 AM

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/.

Tags
RibbonView and RibbonWindow
Asked by
Hugh
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Hugh
Top achievements
Rank 1
Miro Miroslavov
Telerik team
Mike
Top achievements
Rank 1
b
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or