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

Default Alignment

1 Answer 135 Views
CommandBar
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 07 Oct 2011, 01:33 AM
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.

1 Answer, 1 is accepted

Sort by
0
Accepted
Ivan Todorov
Telerik team
answered on 10 Oct 2011, 08:38 AM
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 >>

Tags
CommandBar
Asked by
Richard
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Share this question
or