Tab
A newer version of this page is available. Switch to the current version.

MenuItem.GroupName Property

Gets or sets the name of a logical check group to which the menu item belongs.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

[DefaultValue("")]
public string GroupName { get; set; }
<DefaultValue("")>
Public Property GroupName As String

Property Value

Type Default Description
String

String.Empty

A String value that specifies the group name.

Remarks

Use the GroupName property to specify a logical check group for a menu item. An item's check state can be defined via the MenuItem.Checked property. The capability to manipulate the check state of menu items and combining menu items into logical check groups is useful when, for instance, you use ASPxMenu to implement a kind of toolbar.

A menu item can function as a check box if the item belongs to a logical group defined via the item's GroupName property. To arrange an item/items into a logical group, set its/their GroupName property to the same value. Arranging several menu items into a group makes them function as radio buttons - checking an item unchecks the one previously selected. So, only one menu item in a group can be checked at one time.

ASPxMenuItem_GroupName

NOTE

A menu item's client ASPxClientMenuItem.GetChecked and ASPxClientMenuItem.SetChecked methods are in effect only if the item's GroupName property is defined.

NOTE

If the ASPxMenuBase.AllowSelectItem is enabled or the ASPxMenuBase.ItemLinkMode property is not set to ItemLinkMode.ContentBounds, the check state of menu items cannot be manipulated (obtained or set) on the client side either programmatically or via UI.

Examples

This example demonstrates how the checked state of items can be manipulated to emulate the toolbar behavior (using the ASPxMenu control).

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="DevExpress.Web.v8.3, Version=8.3.2.0, Culture=neutral, 
PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxMenu" TagPrefix="dxm" %>  

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
 <head id="Head1" runat="server">
     <title>Check states of items</title>
 </head>
 <body>
     <form id="form1" runat="server">
         <br/>
          <dxm:ASPxMenu ID="ASPxMenu1" runat="server" ItemSpacing="1px" 
              SeparatorColor="Transparent" 
              SeparatorHeight="15px" SeparatorWidth="2px">
             <Items>
                 <dxm:MenuIte