MenuItem.Alignment Property
Gets or sets the value that specifies a root item’s horizontal layout within the menu.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.1.dll
NuGet Package: DevExpress.Web
Declaration
[DefaultValue(MenuItemAlignment.Default)]
public MenuItemAlignment Alignment { get; set; }
Property Value
Type | Default | Description |
---|---|---|
MenuItemAlignment | Default | A MenuItemAlignment value that specifies the root item’s horizontal layout. |
Available values:
Name | Description |
---|---|
Default | The menu root items are positioned in standard order. |
Left | The menu root items are positioned at the menu’s left. |
Center | The menu root items are positioned at the menu’s center. |
Right | The menu root items are positioned at the menu’s right. |
Remarks
Note that this property is in effect when the ASPxMenu.ItemAutoWidth property is set to false
.
The following example demonstrate how to arrange the menu root items using the Alignment property.
<dx:ASPxMenu ID="ASPxMenu1" runat="server" Width="100%" ItemAutoWidth="false">
<SettingsAdaptivity Enabled="true" />
<Items>
<dx:MenuItem Text="Products"></dx:MenuItem>
<dx:MenuItem Text="Demos"></dx:MenuItem>
<dx:MenuItem Text="Buy"></dx:MenuItem>
<dx:MenuItem Text="Support"></dx:MenuItem>
<dx:MenuItem Text="Blogs"></dx:MenuItem>
<dx:MenuItem Text="About" Alignment="Right"></dx:MenuItem>
<dx:MenuItem Text="Sign In" Alignment="Right" BeginGroup="true"></dx:MenuItem>
</Items>
</dx:ASPxMenu>
The result:
See Also