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

Add empty tab

1 Answer 42 Views
RibbonView and RibbonWindow
This is a migrated thread and some comments may be shown as answers.
Barry
Top achievements
Rank 1
Barry asked on 07 Nov 2014, 01:23 PM
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?

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 12 Nov 2014, 11:20 AM
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.

 
Tags
RibbonView and RibbonWindow
Asked by
Barry
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or