Creating Items at Design Time

In an Unbound Mode, you can use the Items Editor dialog to manually create the ASPxMenu structure at design time.

To invoke this dialog:

  • click the ellipsis button corresponding to the Items property in the Properties window;
  • click the Items... link at the bottom of the Properties window;
  • click the Items... link in the ASPxMenu Tasks menu;
  • click the Items... item in the control context menu.

The Items Editor dialog allows you to add, delete and rearrange items, change item parents, access and customize item settings. The dialog is shown in the image below.

ASPxMenu_Unbound

The Items Editor dialog displays the preview in which you can see an item structure being created. When the OK button is clicked, the aspx code that adds the created items is generated. The code is listed below.

<dx:ASPxMenu ID="ASPxMenu1" runat="server" Orientation="Vertical">
     <Items>
          <dx:MenuItem Text="Home">
          </dx:MenuItem>
          <dx:MenuItem Text="News">
               <Items>
                    <dx:MenuItem Text="Subscriptions">
                    </dx:MenuItem>
                </Items>
          </dx:MenuItem>
           <dx:MenuItem Text="Products">
               <Items>
                    <dx:MenuItem Text="Downloads">
                    </dx:MenuItem>
                    <dx:MenuItem Text="Support">
                    </dx:MenuItem>
                    <dx:MenuItem Text="Order">
                    </dx:MenuItem>
               </Items>
           </dx:MenuItem>
           <dx:MenuItem Text="Client Center">
           </dx:MenuItem>
     </Items>
</dx:ASPxMenu>

You can create items directly in an aspx file, writing a similar code.

The following image shows the result.

ASPxMenu_Unbound2