Skip to main content

CheckBoxProperties.AllowGrayed Property

Gets or sets a value specifying whether the grayed state is available for a check box.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.2.dll

NuGet Package: DevExpress.Web


public bool AllowGrayed { get; set; }

Property Value

Type Default Description
Boolean false

true if the grayed state is available; otherwise, false.


By default, a check box can be set to either the checked or unchecked check state. To enable the third grayed state, set the AllowGrayed property to true. To prohibit end-users from setting the grayed state via a mouse click, set the CheckBoxProperties.AllowGrayedByClick property to false. In this case, you can set a check box to the grayed state programmatically via the ASPxCheckBox.CheckState property on the server side and calling the ASPxClientCheckBox.SetCheckState method on the client side.


  • If the AllowGrayed is set to false, you cannot set the ASPxCheckBox.CheckState property to Indeterminate (the grayed state), it is automatically changed to Unchecked.
  • The AllowGrayed property is not in effect for the radio button.


This example illustrates how to customize ASPxCheckBox and GridViewDataCheckColumn if database data is kept in a format different from Boolean.

<dx:ASPxGridView ID="grid" runat="server" AutoGenerateColumns="False" DataSourceID="xds"
        <dx:GridViewCommandColumn VisibleIndex="0" ShowEditButton="True"/>
        <dx:GridViewDataTextColumn FieldName="Oid" ReadOnly="True" VisibleIndex="1" SortOrder="Ascending">
        <dx:GridViewDataTextColumn FieldName="Title" VisibleIndex="2" Visible="false">
            <EditFormSettings Visible="True" />
        <dx:GridViewDataCheckColumn FieldName="Allow" VisibleIndex="3">
            <PropertiesCheckEdit AllowGrayed="true" ValueType="System.String" ValueChecked="allowed"
                ValueUnchecked="not allowed" ValueGrayed="no information" />
        <dx:GridViewDataCheckColumn FieldName="Active" VisibleIndex="4">
                <dx:ASPxCheckBox ID="chk" runat="server" AllowGrayed="true" ValueType="System.Int32"
                    ValueChecked="1" ValueUnchecked="-1" ValueGrayed="0" Value='<%# Eval("Active") %> '
            <EditFormSettings Visible="False" />
<dx:XpoDataSource ID="xds" runat="server" TypeName="MyObject">
See Also