Ticket T299059
Visible to All Users

How to limit WebActionContainer's width to its parent control width

created 9 years ago

Hi,
In an xaf Web app I am adding actions to an Action Container in run time. And place it on a detail view. I want to limit actionContainer's with to its parent control width, and want to wrap actions when actions total width wider than its parent control width.
How can i accomplish this task with a Xaf Web Application.

A sample solutions is attached that showing the problem.

Regards,

Akın GÜNEŞ
GÜNCEL YAZILIM

Answers approved by DevExpress Support

created 9 years ago (modified 8 years ago)

The menu is additionally initialized in its Init event, so the Menu.ItemWrap property value is overridden. To avoid this, subscribe to the ActionContainerHolder or Menu Load event, and set up the menu as required there:

C#
private void ActionContainer_ControlCreated(object sender, EventArgs e) { ActionContainerHolder control = (ActionContainerHolder)((WebActionContainerViewItem)sender).Control; control.Load += control_Load; } void control_Load(object sender, EventArgs e) { ActionContainerHolder control = (ActionContainerHolder)sender; control.Menu.ItemAutoWidth = false; control.Width = Unit.Pixel(600); control.Menu.ItemWrap = true; // control.Menu.Style.Add("min-width", "700px! important"); control.Menu.Style.Add("max-width", "700px"); control.Menu.Width = Unit.Pixel(600); control.Menu.ItemStyle.Wrap = DevExpress.Utils.DefaultBoolean.True; }

Let me know if you need further assistance.

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.