Hello,
I would like to know how to align an entire toolbar on the right side. I know how to align Tools in the toolbar on the righ side with the label tool spring property set to true but I can't find the setting to align an entire toolbar to the right. Thanks for your help in advance.
There is no property to align the toolbar like this. You can submit a feature request for this here: http://devcenter.infragistics.com/Protected/RequestFeature.aspx.
You can also try to use a creation filter to manually align the toolbar. If you have never used creation filters before, the following article gives a brief overview: http://help.infragistics.com/Help/NetAdvantage/NET/2008.1/CLR2.0/html/Win_Creation_Filter.html. Your BeforeCreateChildElements would just return False. In your AfterCreateChildElements implementation, if the parent element passed in is of type UltraToolbarsDockAreaUIElement, iterate it's ChildElements collection until you find an element with the type ToolbarUIElement whose Toolbar property is the toolbar you want to right align. Change its Rect like this:
Rectangle rect = toolbarElement.Rect;
rect.X = dockAreaElement.RectInsideBorders.Right - rect.Width;
toolbarElement.Rect = rect;
Thanks for your quick response. It works fine except two things.
1. User can't move anymore the toolbar on the toolbardockingarea
2. When the toolbar is in floating mode all items inside the toolbar disapear.
Thanks in advance,
Thomas
Thanks for your advices. It's really helpfull :)
NODEVO said:2. When the toolbar is in floating mode all items inside the toolbar disapear.
It would probably be better to not do anything in the creation filter if the toolbar is floating. You can check the DockedPosition of the toolbar before changing its position. If it returns Floating, don't change the Rect.
NODEVO said:1. User can't move anymore the toolbar on the toolbardockingarea
Hmm....I didn't consider user dragging at first. It might make this a little more complicated. You could try to only change the Rect when the form resizes or you could try to track when the user is dragging and not change the Rect when that occurs. However, if the user moves the toolbar from the right edge of the form to the middle of its dock row and the form is resized or the toolbar appearance changes for any reason, the toolbar will jump over to the right edge again. You would need to track the user customizations to the location and add them back into the location of your new Rect. On second thought, it might be better just to submit the feature request.