Hide/Collapse tab strip in RibbonView

10 posts, 1 answers
  1. Hugh
    Hugh avatar
    16 posts
    Member since:
    Oct 2011

    Posted 09 Feb 2012 Link to this post

    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?
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 10 Feb 2012 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Hugh
    Hugh avatar
    16 posts
    Member since:
    Oct 2011

    Posted 10 Feb 2012 Link to this post

    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.
  5. Hugh
    Hugh avatar
    16 posts
    Member since:
    Oct 2011

    Posted 13 Feb 2012 Link to this post

    Is there no way to do this?
  6. Answer
    Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 15 Feb 2012 Link to this post

    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 >>
  7. Hugh
    Hugh avatar
    16 posts
    Member since:
    Oct 2011

    Posted 15 Feb 2012 Link to this post

    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.
  8. Mike
    Mike avatar
    8 posts
    Member since:
    Jul 2010

    Posted 23 Feb 2012 Link to this post

    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.
  9. Hugh
    Hugh avatar
    16 posts
    Member since:
    Oct 2011

    Posted 23 Feb 2012 Link to this post

    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>


    .... 

  10. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 28 Feb 2012 Link to this post

    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 >>
  11. Mike
    Mike avatar
    8 posts
    Member since:
    Jul 2010

    Posted 28 Feb 2012 Link to this post

    Thanks very much for the help, Hugh and Tina, the workaround functions fine for me.
Back to Top
UI for WPF is Visual Studio 2017 Ready