Tab

ASPxMenu.ItemAutoWidth Property

Gets or sets a value that specifies whether root item widths are calculated automatically, so that root items are resized (stretched or shrinked) proportionally to the menu control’s width.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v21.1.dll

Declaration

[DefaultValue(true)]
public bool ItemAutoWidth { get; set; }

Property Value

Type Default Description
Boolean

true

true if item widths are calculated automatically; otherwise, false.

Remarks

Use the ItemAutoWidth property to control how root item widths are calculated within a menu control.

If the ItemAutoWidth property is set to true (the default behavior), the widths of root menu items depend upon a menu control’s width specified via the Width property. In this case, root items are automatically resized in proportion to the defined menu width. An individual item’s width might depend upon the length of the item’s text. This mode is illustrated by the following image.

ItemAutoWidth = True  

APSxMenu_ItemAutoWidth-True.png

If the ItemAutoWidth property is set to false, root menu item widths are not related to the width of the menu control. In this case, a common width for root items can be defined using the MenuItemStyleBase.Width property available via the ASPxMenuBase.ItemStyle property, and the width of an individual item might depend upon the length of the item’s text as well. The horizontal alignment of the root menu items can be specified by using the ASPxMenu.HorizontalAlign property. The following images illustrate how the settings of these properties affect the layout of the menu’s root items.

ItemAutoWidth = False

HorizontalAlign = Left

APSxMenu_ItemAutoWidth-False_HA-Left.png

ItemAutoWidth = False

HorizontalAlign = Center

APSxMenu_ItemAutoWidth-False_HA-Center.png

ItemAutoWidth = False

HorizontalAlign = Right

APSxMenu_ItemAutoWidth-False_HA-Right.png

See Also