Skip to main content

ASPxMenu.HorizontalAlign Property

Gets or sets the horizontal alignment of menu items.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.2.dll

NuGet Package: DevExpress.Web


public HorizontalAlign HorizontalAlign { get; set; }

Property Value

Type Default Description
HorizontalAlign NotSet

One of the HorizontalAlign enumeration values.


If a menu control’s Width property is defined and the ASPxMenu.ItemAutoWidth property is set to false, the HorizontalAlign property can be used to specify the horizontal alignment of menu items.


This example demonstrates the use of the client SetPopupElementID(popupElementId) method. This method allows you to programmatically specify the element whose specific mouse action (defined via the PopupAction property) invokes a popup window or popup menu. In this example, the grid’s last column displays image elements, which being hovered, invoke a popup menu, allowing you to manipulate the corresponding grid row (select, unselect or edit the row). The popup menu is associated with the required image element using the menu’s SetPopupElementID(popupElementId) method.

var currentRowKey = 0;
function OnMouseOver(element, keyValue) {
    currentRowKey = keyValue; = "popupElement" + keyValue;
function EditCurrentRow() {
function SelectCurrentRow() {
    ClientGridView.SelectRowsByKey(currentRowKey, true);
function UnselectCurrentRow() {
    ClientGridView.SelectRowsByKey(currentRowKey, false);
<dx:ASPxPopupMenu ID = "ASPxPopupMenu" runat = "server" ClientInstanceName = "ClientPopupMenu"
                    PopupAction = "LeftMouseClick" CloseAction = "MouseOut" 
                    PopupHorizontalAlign = "OutsideRight" PopupVerticalAlign = "TopSides">
        <dx:MenuItem Text="Edit" Name="editMenuItem"/>
        <dx:MenuItem Text="Select" Name="selectMenuItem"/>
        <dx:MenuItem Text="Unselect" Name="unselectMenuItem"/>
    <ClientSideEvents ItemClick="function(s, e) { 
        if( == 'editMenuItem') 
        else if ( == 'selectMenuItem')
        else if ( == 'unselectMenuItem')
        }"  />

<dx:ASPxGridView ID="ASPxGridView" ClientInstanceName="ClientGridView" runat="server" 
                    DataSourceID="AccessDataSource" KeyFieldName="CustomerID" Width="50%" >
        <dx:GridViewDataColumn FieldName="ContactName" />
        <dx:GridViewDataColumn FieldName="CompanyName" />
        <dx:GridViewDataColumn FieldName="City" />
        <dx:GridViewDataColumn FieldName="Region" />
        <dx:GridViewDataColumn FieldName="Country" />
        <dx:GridViewDataColumn Caption="" CellStyle-HorizontalAlign = "Center">
                    <img src = "img/arrow.png" style="cursor:pointer;" alt = "" 
                            onmouseover = "OnMouseOver(this, '<%# Container.KeyValue %>')"/>
    <SettingsPager Mode="ShowPager" PageSize = "10"/>
    <SettingsBehavior AllowMultiSelection="true" />
See Also