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

How to removed dotted vertical line in CommandBar?

4 Answers 153 Views
CommandBar
This is a migrated thread and some comments may be shown as answers.
André
Top achievements
Rank 1
André asked on 07 Oct 2011, 01:29 AM
Hi!

How can I remove the dotted vertical line positioned on the left side of a CommandBar?

Thanks!

4 Answers, 1 is accepted

Sort by
0
Accepted
Ivan Petrov
Telerik team
answered on 10 Oct 2011, 08:51 AM
Hi André,

Thank you for writing.

If by "dotted vertical line" you mean the grips that are used to move the strip items, then you can hide them using the following code:

foreach (CommandBarRowElement row in this.radCommandBar1.Rows)
{
  foreach (CommandBarStripElement strip in row.Strips)
  {
    strip.Grip.Visibility = ElementVisibility.Collapsed;
  }
}

If this is not what you want to achieve, I would kindly ask you to provide some more details on what you mean and if possible a screen shot would be very helpful.

Best wishes,
Ivan Petrov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Franco
Top achievements
Rank 1
answered on 17 Jan 2012, 12:32 PM
Ok, this works for me, but now the image is too close to the left border (see image attached). I tried with the Padding | Left property of the strip, but the extra space is added to the right. Maybe a bug?
How can I add extra space to the left of the strip?
Thank you
Gianfranco
0
Ivan Petrov
Telerik team
answered on 20 Jan 2012, 12:00 PM
Hello Franco,

Thank you for writing.

You can change the distance by controlling the Grip width. For this you have to remove the image and set the maximum size of the grip. Also you have to set the visibility to hidden so the grip element will actually be measured and will take up space in the layout. Here is a modified version of the previous code which achieves this:
foreach (CommandBarRowElement row in this.radCommandBar1.Rows)
{
  foreach (CommandBarStripElement strip in row.Strips)
  {
    strip.Grip.Image = null;
    strip.Grip.MaxSize = new System.Drawing.Size(3, 0);
    strip.Grip.Visibility = ElementVisibility.Hidden;
  }
}

I hope this helps.

Kind regards,
Ivan Petrov
the Telerik team

SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).

0
Franco
Top achievements
Rank 1
answered on 23 Jan 2012, 09:18 AM
Thank you very much.
It works!
Gianfranco
Tags
CommandBar
Asked by
André
Top achievements
Rank 1
Answers by
Ivan Petrov
Telerik team
Franco
Top achievements
Rank 1
Share this question
or