Declined
Last Updated: 30 May 2014 10:50 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 19 May 2014 06:08
Category: CommandBar
Type: Bug Report
0
FIX. RadCommandBar - Incorrect layout when collapsing the Grip and the OverflowButton of the CommandBarStripElement
DECLINED: RadCommandBar assigns the DesiredLocation of each strip on the first layout pass and keeps this value until a different one is explicitly specified (via drag or via setting the property). The difference in the initial DesiredSize of the strips (depending on whether they have the grip/overflow button collapsed) results in different initial DesiredLocation settings. The proper way to avoid the gaps is to explicitly set the DesiredLocation property of each strip when collapsing the grips and overflow buttons.


To reproduce:

1.Add a RadCommandBar with several CommandBarStripElement. Each strip should contain a single button element.

2.Add a RadButton.

3.Use the following code snippet:

private Dictionary<ElementVisibility, ElementVisibility> toggle;
public Form1()
{
    InitializeComponent(); 


  toggle = new Dictionary<ElementVisibility, ElementVisibility>();
  toggle[ElementVisibility.Collapsed] = ElementVisibility.Visible;
  toggle[ElementVisibility.Hidden] = ElementVisibility.Visible;
  toggle[ElementVisibility.Visible] = ElementVisibility.Collapsed;
}


private void ButtonClick()
{
  foreach (var row in radCommandBar1.Rows)
  {
    foreach (var strip in row.Strips)
    {
      Toggle(strip);
    }
  }
}


private void radButton1_Click(object sender, EventArgs e)
{
  ButtonClick();
}


private void Toggle(Telerik.WinControls.UI.CommandBarStripElement strip)
{
  Toggle(strip.Grip);
  Toggle(strip.OverflowButton);
}


private void Toggle(Telerik.WinControls.RadElement element)
{
  element.Visibility = toggle[element.Visibility];
}


If you collapse the Grip and the OverflowButton of a CommandBarStripElement, there is a gap between CommandBarStripElements.

Workaround: call the ButtonClick method in the form constructor.




1 comment
ADMIN
Ivan Todorov
Posted on: 30 May 2014 10:50
DECLINED: RadCommandBar assigns the DesiredLocation of each strip on the first layout pass and keeps this value until a different one is explicitly specified (via drag or via setting the property). The difference in the initial DesiredSize of the strips (depending on whether they have the grip/overflow button collapsed) results in different initial DesiredLocation settings. The proper way to avoid the gaps is to explicitly set the DesiredLocation property of each strip when collapsing the grips and overflow buttons.