Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q2 2011 released 07/12/2011
select

Menu / Expand Direction


  • You can control the direction, in which the child menu items expand.

    The GroupSettings class exposes the ExpandDirection property. By setting this property for a particular item, you define the expanding direction of the item's children. The possible values are Auto (default), which is determined by the flow of the parent group, Up, Down, Left, and Right.

    The default Auto value will expand child items:

    • downward, if the parent group is horizontal;
    • to the right, if the parent group is vertical.

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="c#" CodeFile="DefaultCS.aspx.cs" AutoEventWireup="true" Inherits="Telerik.Web.Examples.Menu.ExpandDirection.DefaultCS" %>

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <qsf:HeadTag ID="Headtag1" runat="server"></qsf:HeadTag>
    </head>
    <body class="BODY">
        <form id="mainForm" method="post" runat="server">
            <telerik:RadScriptManager ID="ScriptManager" runat="server" />
            <qsf:Header ID="Header1" runat="server" NavigationLanguage="C#"></qsf:Header>
            <telerik:RadMenu ID="RadMenu1" runat="server" EnableRoundedCorners="true" EnableShadows="true">
                <Items>
                    <telerik:RadMenuItem Text="About us">
                        <Items>
                            <telerik:RadMenuItem Text="Mission Statement">
                            </telerik:RadMenuItem>
                            <telerik:RadMenuItem Text="Strategic Plan">
                            </telerik:RadMenuItem>
                            <telerik:RadMenuItem Text="Executive Bios">
                            </telerik:RadMenuItem>
                            <telerik:RadMenuItem Text="Contact Us">
                            </telerik:RadMenuItem>
                        </Items>
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Text="Products">
                        <GroupSettings ExpandDirection="Up"></GroupSettings>
                        <Items>
                            <telerik:RadMenuItem Text="Automotive">
                            </telerik:RadMenuItem>
                            <telerik:RadMenuItem Text="Machinery">
                            </telerik:RadMenuItem>
                            <telerik:RadMenuItem Text="Software">
                            </telerik:RadMenuItem>
                            <telerik:RadMenuItem Text="Customer Goods">
                            </telerik:RadMenuItem>
                        </Items>
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Text="Contact Us">
                        <GroupSettings ExpandDirection="Right"></GroupSettings>
                        <Items>
                            <telerik:RadMenuItem Text="Europe">
                            </telerik:RadMenuItem>
                            <telerik:RadMenuItem Text="Asia">
                            </telerik:RadMenuItem>
                            <telerik:RadMenuItem Text="America">
                            </telerik:RadMenuItem>
                        </Items>
                    </telerik:RadMenuItem>
                </Items>
            </telerik:RadMenu>
            <br />
            <br />
            <br />
            <br />
            <qsf:Footer ID="Footer1" runat="server"></qsf:Footer>
        </form>
    </body>
    </html>

Get more than expected!

 
 

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2024 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451