Skip to main content

ASPxMenu.Orientation Property

Gets or sets the direction in which to render the menu.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web


public Orientation Orientation { get; set; }

Property Value

Type Default Description
Orientation Horizontal

One of the Orientation enumeration values.


Use the Orientation property to specify the direction in which to render the menu control.

On the client side, you can control the menu orientation using the ASPxClientMenu.GetOrientation and ASPxClientMenu.SetOrientation methods.


This sample illustrates how to keep the NavigateUrl of the item if there is a control in the ItemTemplate of the ASPxMenu.

<dx:ASPxMenu ID="ASPxMenu1" runat="server" DataSourceID="ASPxSiteMapDataSource1"
    Orientation="Vertical" OnDataBound="ASPxMenu1_DataBound">
        <dx:ASPxLabel ID="ASPxLabel1" runat="server" Text='<%#Container.Item.Text %>' 
                      Width="100px" Height="20px" Cursor="pointer">

protected void ASPxMenu1_DataBound(object sender, EventArgs e) {
    string url = "";
    for (int i = 0; i < ASPxMenu1.Items.Count; i++) {

        url = ASPxMenu1.Items[i].NavigateUrl;
        ASPxLabel lab = ASPxMenu1.Items[i].FindControl("ASPxLabel1") as ASPxLabel;
        if (lab != null) {
            lab.ClientSideEvents.Click = "function(s,e){window.location = '" + url + "';}";

            switch (lab.Text) {
                case "Yahoo!": {
                        lab.BackColor = System.Drawing.Color.LightPink;
                case "MSN": {
                        lab.BackColor = System.Drawing.Color.LightSkyBlue;
                case "Google": {
                        lab.BackColor = System.Drawing.Color.LightSeaGreen;
See Also