Skip to main content
Tab

CheckBoxProperties.ValueChecked Property

Gets or sets the value that represents the editor’s checked state.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

[DefaultValue(true)]
public object ValueChecked { get; set; }

Property Value

Type Default Description
Object true

A Object value that represents the checked state of the check box editor.

Remarks

Use the ValueChecked property to specify the value which represents the checked state of the check box editor. This value is assigned to the editor’s ASPxEditBase.Value when the editor is switched to the checked state.

Note

  • The ValueChecked property synchronizes its value with the editor’s ASPxCheckBox.ValueChecked property.
  • The ValueChecked property is not in effect for the radio button.

Example

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