I'm trying to programmatically add a tab to the Ribbonbar at runtime. It all works fine when the Ribbonbar is expanded. But when I add a tab to a collapsed Ribbonbar the new tab is not visible until I click the button to expand the Ribbonbar again. Here are the steps to reproduce:
1.Create a new Visual C# -> Telerik Windows Forms Application
2.Drag a RadRibbonBar control onto RadForm1
3.Create a single tab "First Tab" (otherwise you cannot collapse the ribbon)
4.Drag a button onto the form and add the following code to the click event handler:
RibbonTab tab = new RibbonTab("Test");
this.radRibbonBar1.CommandTabs.Add(tab);
tab.IsSelected = true;
5.You should end up with something like the attached png file.
6.Run the project and click the button. You should see the new tab is created and selected.
7.Close the project and run it again. This time collapse the ribbon before clicking the button. No new tab is visible on the ribbon. Even if you click on the [First Tab] to show the full ribbon.
8.Click the expand ribbon button on the right and the new tab will then appear.
I've tried adding lines like Application.DoEvents() or this.Refresh() or this.radRibbonBar1.Refresh() but it doesn't make a difference.
Any help would be much appreciated.
Thanks,
John