Add empty tab

2 posts, 0 answers
  1. Barry
    Barry avatar
    90 posts
    Member since:
    Jul 2011

    Posted 07 Nov 2014 Link to this post

    Is there any way to add an empty tab to the ribbonview? I have a few tabs that need a number of controls in them, but then I have one tab that I don't need any controls in... so it is just sitting there empty. I have tried collapsing the ribbon when moving to that tab, but it works fine in debug but then crashes the app when deployed. Is there a way to add a tab just for navigation without having any space for controls in it?
  2. Martin
    Admin
    Martin avatar
    1099 posts

    Posted 12 Nov 2014 Link to this post

    Hi Barry,

    In order to achieve your requirement you can try to minimize the ribbon view control when you select the tab with the empty content. Basically you can subscribe to the SelectionChanged event of RadRibbonView and inside its handler set the ribbon's IsMinimized property to true.

    Here is a sample in code:
    private void ribbon_SelectionChanged(object sender, RadSelectionChangedEventArgs e)
    {
        if (e.AddedItems.Count > 0)
        {
            var tab = e.AddedItems[0] as RadRibbonTab;
     
            if (tab.Header.ToString() == "Tab 2")
            {
                this.ribbon.IsMinimized = true;
                 
            }
            else if (tab.Header.ToString() != "Tab 2" && this.ribbon.IsMinimized)
            {
                this.ribbon.IsMinimized = false;
            }
        }
    }

    Also, can you please tell me how you are collapsing the ribbon in your implementation? This will allow me to understand it better and assist you further with the app's crash.

    Regards,
    Martin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. DevCraft banner
Back to Top