Version

Separators

WebDataMenu™ can have menu- items that can be rendered as a separator by simply setting the DataMenuItem object’s IsSeparator property to True.

Note
Note:

When a menu-item’s IsSeparator property is set to True, all other properties are ignored and the item will be rendered as a separator.

To render menu-item as a separator :

  1. From the Visual Studio™ Toolbox, drag and drop the ScriptManager Component and the WebDataMenu control onto your WebForm.

  2. Add menu-items to the WebDataMenu through the designer as shown in the following image:

WebDataMenu Separators 01.png

For more information on how to add menu-items to WebDataMenu, see the Getting Started with WebDataMenu topic.

  1. Set the IsSeparator property of Separator1 and Separator2 items to True.

  2. Click Apply and OK to close the designer.

  3. The designer generate the following code in the mark-up:

In HTML:

   <ig:WebDataMenu ID="WebDataMenu1" runat="server">
        <Items>
            <ig:DataMenuItem Text="File">
                <Items>
                    <ig:DataMenuItem Text="Open">
                    </ig:DataMenuItem>
                    <ig:DataMenuItem IsSeparator="True">
                    </ig:DataMenuItem>
                    <ig:DataMenuItem Text="Save">
                    </ig:DataMenuItem>
                    <ig:DataMenuItem IsSeparator="True">
                    </ig:DataMenuItem>
                    <ig:DataMenuItem Text="Exit">
                    </ig:DataMenuItem>
                </Items>
            </ig:DataMenuItem>
            <ig:DataMenuItem Text="Edit">
                <Items>
                    <ig:DataMenuItem Text="Cut">
                    </ig:DataMenuItem>
                    <ig:DataMenuItem Text="Copy">
                    </ig:DataMenuItem>
                    <ig:DataMenuItem Text="Paste">
                    </ig:DataMenuItem>
                </Items>
            </ig:DataMenuItem>
        </Items>
    </ig:WebDataMenu>
  1. Save and run your application. You will observe separators between Open and Save and also between Save and Exit similar to the following image:

WebDataMenu Separators 02.png