How to removed dotted vertical line in CommandBar?

5 posts, 1 answers
  1. André
    André avatar
    5 posts
    Member since:
    Jul 2008

    Posted 06 Oct 2011 Link to this post

    Hi!

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

    Thanks!
  2. Answer
    Ivan Petrov
    Admin
    Ivan Petrov avatar
    701 posts

    Posted 10 Oct 2011 Link to this post

    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 >>

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Franco
    Franco avatar
    27 posts
    Member since:
    Apr 2010

    Posted 17 Jan 2012 Link to this post

    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
  5. Ivan Petrov
    Admin
    Ivan Petrov avatar
    701 posts

    Posted 20 Jan 2012 Link to this post

    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).

  6. Franco
    Franco avatar
    27 posts
    Member since:
    Apr 2010

    Posted 23 Jan 2012 Link to this post

    Thank you very much.
    It works!
    Gianfranco
Back to Top
UI for WinForms is Visual Studio 2017 Ready