Default Alignment

2 posts, 1 answers
  1. Richard
    Richard avatar
    32 posts
    Member since:
    Aug 2010

    Posted 06 Oct 2011 Link to this post

    Hi,

    How do I set the default alignment of the command bar to the right?

    For example see attached screenshot "before".
    What I want to do is display the commandbar on the right by default as shown in screenshot "after".

    I have tried setting the Alignment property of CommandBarStripElement to "TopRight", but this does not make a difference.

    Regards.
  2. Answer
    Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 10 Oct 2011 Link to this post

    Hi Richard,

    Thank you for contacting us.

    The RadCommandBar has a specific layout mechanism which arranges the strips from left to right. To achieve the desired effect you can set the RightToLeft property of RadCommandBar to RightToLeft.Yes. However, this mode is indented to use with right-to-left languages and will turn all the elements in RadCommandBar right-to-left. Therefore, it might not fit your scenario well.

    Another approach is to set the DesiredLocation property of each CommandBarStripElement to a point with a very large X value:
    this.commandBarStripElement1.DesiredLocation = new PointF(100000, 0);

    However, if the user drags the strips, this will internally change the DesiredLocation property. To avoid this, you can disable dragging by setting the following property:
    this.commandBarStripElement1.EnableDragging = false;

    I hope you find this useful. In case you need further help, do not hesitate to contact us.

    All the best,
    Ivan Todorov
    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
Back to Top