MenuItem.Checked Property

Gets or sets whether the menu item is checked.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v20.2.dll


public bool Checked { get; set; }

Property Value

Type Default Description


true if the menu item is in the checked state; otherwise, false.


Use the Checked property to specify the menu item's check state (checked or unchecked). The capability to manipulate the check state of menu items 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 MenuItem.GroupName property. To arrange an item/items into a logical group, set its/their MenuItem.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.



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.


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=, Culture=neutral, 
    Namespace="DevExpress.Web.ASPxMenu" TagPrefix="dxm" %>  

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 

<script runat="server">

<html xmlns="" >
 <head id="Head1" runat="server">
     <title>Check states of items</title>
     <form id="form1" runat="server">
          <dxm:ASPxMenu ID="ASPxMenu1" runat="server" ItemSpacing="1px" 
              SeparatorHeight="15px" SeparatorWidth="2px">
                 <dxm:MenuItem GroupName="Bold" Text="">
                     <Image Url="~/ASPxperience/Menu/Images/bold.gif" />
                 <dxm:MenuItem GroupName="Italic" Text="">
                     <Image Url="~/ASPxperience/Menu/Images/italic.gif" />
                 <dxm:MenuItem GroupName="Underline" Text="">
                     <Image Url="~/ASPxperience/Menu/Images/underline.gif" />
                 <dxm:MenuItem BeginGroup="True" GroupName="Align" Text="" Checked="True">
                     <Image Url="~/ASPxperience/Menu/Images/left.gif" />
                 <dxm:MenuItem GroupName="Align" Text="">
                     <Image Url="~/ASPxperience/Menu/Images/center.gif" />
                 <dxm:MenuItem GroupName="Align" Text="">
                     <Image Url="~/ASPxperience/Menu/Images/right.gif" />
                 <dxm:MenuItem GroupName="Align" Text="">
                     <Image Url="~/ASPxperience/Menu/Images/justify.gif" />
                 <Paddings Padding="2px" />
                 <HoverStyle BackColor="#B6BDD2&q