New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Expanding and Offsetting Items

RadMenu showing different expand directions.

  • About us
    • Mission Statement
    • Strategic Plan
    • Executive Bios
    • Contact Us
  • Products
    • Automotive
    • Machinery
    • Software
    • Customer Goods
  • Contact Us
    • Europe
    • Asia
    • America

RadMenu showing offset options for child items.

  • Save As
    • Word Document
    • Word Template
    • Adobe PDF
    • Other formats
  • Print
    • Print
    • Quick Print
    • Print Preview
  • Publish
    • Run Compatibility Checker
    • Blog
    • Document Management Server
    • Create Document Workspace
  • Send
    • E-mail
    • Create Adobe PDF and Email
    • Create Adobe PDF and Send for Review
    • Internet Fax
  • Prepare
    • Properties
    • Inspect Document
    • Encrypt Document
    • Restrict Permission
    • Add a Digital Signature
    • Mark as Final
  • Close
  • Offset Configurations

This demo exemplified two main features of the RadMenu control - how to explicitly set the expand direction of the items (using the GroupSettings) and how to explicitly specify the position where the items should appear.

The Offsetting Items group demonstrates how you can change the default setting for a particular group of items, so that the child items expand somewhere else on the page.

To allow this, the RadMenuItem.GroupSettings class exposes the OffsetX and OffsetY properties. They indicate the horizontal and vertical offset of child menu items. The offset is measured in pixels. You will also need to know that the value is relative to the parent item: the default value in both axes is 0 (no offset).

The Expand Direction section exemplifies how you can use the GroupSettings class. It exposes the ExpandDirection property that controls the expanding direction of the item's children. The values that you can use are Auto (that is the default one) 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.
  • DefaultCS.aspx
  • DefaultCS.aspx.cs
  • styles.css
<%@ Page Language="c#" CodeFile="DefaultCS.aspx.cs" AutoEventWireup="true" Inherits="Menu.Examples.Functionality.ExpandDirection.DefaultCS" %>

<!DOCTYPE html>
<html xmlns=''>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link href="styles.css" rel="stylesheet" />

    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />

    <div class="demo-container size-medium">

        <h2>RadMenu showing different expand directions.</h2>
        <telerik:RadMenu RenderMode="Lightweight" ID="RadMenu1" runat="server" EnableRoundedCorners="true" EnableShadows="true">
                <telerik:RadMenuItem Text="About us">
                        <telerik:RadMenuItem Text="Mission Statement" />
                        <telerik:RadMenuItem Text="Strategic Plan" />
                        <telerik:RadMenuItem Text="Executive Bios" />
                        <telerik:RadMenuItem Text="Contact Us" />
                <telerik:RadMenuItem Text="Products">
                    <GroupSettings ExpandDirection="Up" />
                        <telerik:RadMenuItem Text="Automotive" />
                        <telerik:RadMenuItem Text="Machinery" />
                        <telerik:RadMenuItem Text="Software" />
                        <telerik:RadMenuItem Text="Customer Goods" />
                <telerik:RadMenuItem Text="Contact Us">
                    <GroupSettings ExpandDirection="Right" />
                        <telerik:RadMenuItem Text="Europe" />
                        <telerik:RadMenuItem Text="Asia" />
                        <telerik:RadMenuItem Text="America" />


    <telerik:RadAjaxManager ID="AjaxManager" runat="server">
            <telerik:AjaxSetting AjaxControlID="ConfigurationPanel">
                    <telerik:AjaxUpdatedControl ControlID="RadMenu2" />

    <div class="demo-container size-medium">

        <h2>RadMenu showing offset options for child items.</h2>
        <telerik:RadMenu RenderMode="Lightweight" ID="RadMenu2" runat="server" Flow="Vertical" Width="200">
                <telerik:RadMenuItem Text="Save As" ImageUrl="images/14SaveAs.gif" GroupSettings-Flow="Vertical"
                        <telerik:RadMenuItem Text="Word Document" ImageUrl="images/41worddoc.gif" />
                        <telerik:RadMenuItem Text="Word Template" ImageUrl="images/42wordtmpl.gif" />
                        <telerik:RadMenuItem Text="Adobe PDF" ImageUrl="images/44pdf.gif" />
                        <telerik:RadMenuItem Text="Other formats" ImageUrl="images/45other.gif" />
                <telerik:RadMenuItem Text="Print" ImageUrl="images/16print.gif" GroupSettings-Flow="Vertical"
                        <telerik:RadMenuItem Text="Print" ImageUrl="images/16print.gif" />
                        <telerik:RadMenuItem Text="Quick Print" ImageUrl="images/16print.gif" />
                        <telerik:RadMenuItem Text="Print Preview" ImageUrl="images/15printPreview.gif" />
                <telerik:RadMenuItem Text="Publish" ImageUrl="images/16publish.gif" GroupSettings-Flow="Vertical"
                        <telerik:RadMenuItem Text="Run Compatibility Checker" ImageUrl="images/07compatibility.gif" />
                        <telerik:RadMenuItem Text="Blog" ImageUrl="images/31blog.gif" />
                        <telerik:RadMenuItem Text="Document Management Server" ImageUrl="images/32docmngr.gif" />
                        <telerik:RadMenuItem Text="Create Document Workspace" ImageUrl="images/33docwspc.gif" />
                <telerik:RadMenuItem Text="Send" ImageUrl="images/16send.gif" GroupSettings-Flow="Vertical"
                        <telerik:RadMenuItem Text="E-mail" ImageUrl="images/21email.gif" />
                        <telerik:RadMenuItem Text="Create Adobe PDF and Email" ImageUrl="images/22emailpdf.gif" />
                        <telerik:RadMenuItem Text="Create Adobe PDF and Send for Review" ImageUrl="images/23reviewpdf.gif" />
                        <telerik:RadMenuItem Text="Internet Fax" ImageUrl="images/24inetfax.gif" />
                <telerik:RadMenuItem Text="Prepare" ImageUrl="images/16prepare.gif" GroupSettings-Flow="Vertical"
                        <telerik:RadMenuItem Text="Properties" ImageUrl="images/01properties.gif" />
                        <telerik:RadMenuItem Text="Inspect Document" ImageUrl="images/02inspect.gif" />
                        <telerik:RadMenuItem Text="Encrypt Document" ImageUrl="images/03encrypt.gif" />
                        <telerik:RadMenuItem Text="Restrict Permission" ImageUrl="images/04restrictperm.gif" />
                        <telerik:RadMenuItem Text="Add a Digital Signature" ImageUrl="images/05addsign.gif" />
                        <telerik:RadMenuItem Text="Mark as Final" ImageUrl="images/06markfinal.gif" />
                <telerik:RadMenuItem IsSeparator="true" />
                <telerik:RadMenuItem Text="Close" ImageUrl="images/17close.gif" />
            <ExpandAnimation Type="None" />
            <CollapseAnimation Type="None" />


    <qsf:ConfiguratorPanel ID="ConfigurationPanel" runat="server" Title="Offset Configurations">
                <ul class="fb-group">
                        <qsf:NumericTextBox ID="editOffsetX" runat="server" Size="Narrow" CssClass="qsfexInput" Value="0" Label="Offset X:"></qsf:NumericTextBox>
                        <asp:RequiredFieldValidator ID="Requiredfieldvalidator1" runat="server" ControlToValidate="editOffsetX"
                            ErrorMessage="integer between -200 and 200" Display="Dynamic">
                        <asp:RangeValidator ID="Rangevalidator1" runat="server" ControlToValidate="editOffsetX"
                            Type="Integer" MinimumValue="-200" MaximumValue="200" ErrorMessage="Value must be between -200 and 200"
                            Display="Dynamic" CssClass="qsfexValidator">
                        <qsf:NumericTextBox ID="editOffsetY" runat="server" Size="Narrow" CssClass="qsfexInput" Value="0" Label="Offset Y:"></qsf:NumericTextBox>
                        <asp:RequiredFieldValidator ID="Requiredfieldvalidator2" runat="server" ControlToValidate="editOffsetY"
                            ErrorMessage="integer between -200 and 200" Display="Dynamic" CssClass="qsfexValidator"></asp:RequiredFieldValidator>
                        <asp:RangeValidator ID="Rangevalidator2" runat="server" ControlToValidate="editOffsetY"
                            Type="Integer" MinimumValue="-200" MaximumValue="200" ErrorMessage="Value must be between -200 and 200"
                            Display="Dynamic" CssClass="qsfexValidator"></asp:RangeValidator>
                        <qsf:Button runat="server" ID="btnApplyChanges" Size="Narrow" Text="Apply" OnClick="btnApplyChanges_Click" />


Support & Learning Resources

Find Assistance