Completed
Last Updated: 26 Oct 2015 15:40 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 14 Oct 2013 01:38
Category: RibbonBar
Type: Bug Report
1
FIX. RadRibbonBar - contextual tab group is not re-sized when some of its tabs are collapsed
To reproduce:
- add RadRibbonBar containing a Contextual tab group (composed of four tabs);
- add several RadRadioButton-s indicating which tab to be visible/collapsed:

private void radRadioButton1_ToggleStateChanged(object sender,
    Telerik.WinControls.UI.StateChangedEventArgs args)
{
    if (args.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On)
    {
        this.ribbonTab1.Visibility = Telerik.WinControls.ElementVisibility.Visible;
    }
    else
    {
        this.ribbonTab1.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
    }
}

As a result, when some tab is collapsed, contextual tab group width is not changed.

======================
Workaround: set collapsed tab width to 0 and update ribbon captions's layout:

ribbonTab1.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
ribbonTab1.Size = new Size(0, this.ribbonTab1.Size.Height);

radRibbonBar1.RibbonBarElement.InvalidateMeasure(true);
radRibbonBar1.RibbonBarElement.UpdateLayout();
radRibbonBar1.RibbonBarElement.RibbonCaption.CaptionLayout.InvalidateMeasure(true);
radRibbonBar1.RibbonBarElement.RibbonCaption.CaptionLayout.UpdateLayout();
0 comments