CheckBoxProperties.CheckedIsValidOnly Property
Specifies whether only the checked state is valid.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
Declaration
Property Value
Type | Default | Description |
---|---|---|
Boolean | false |
|
Remarks
The CheckBoxProperties.CheckedIsValidOnly
property is in effect for a column that displays Boolean
values. Set this property to true
to specify that only the checked state is valid for the built-in ASPxCheckBox editor. In this case, the editor validates check states automatically, so you do not need to define the check box as a required field to enable its validation.
When the CheckBoxProperties.CheckedIsValidOnly
property value is false
or not specified, the IsRequired property defines whether the built-in check box validates its input. With this technique, a validation error occurs for the grayed state only (the checked and unchecked states are valid).
Web Forms Example
<dx:ASPxGridView ID="ASPxGridView1" runat="server">
<!--...-->
<Columns>
<!--...-->
<dx:GridViewDataCheckColumn FieldName="Discontinued">
<PropertiesCheckEdit AllowGrayed="true" CheckedIsValidOnly="true" />
</dx:GridViewDataCheckColumn>
</Columns>
</dx:ASPxGridView>
MVC Example
@Html.DevExpress().GridView(settings => {
settings.Name = "MVCxGridView1";
//...
settings.Columns.Add(c => {
c.FieldName = "Discontinued";
c.ColumnType = MVCxGridViewColumnType.CheckBox;
CheckBoxProperties checkBoxSettings = new CheckBoxProperties
{
AllowGrayed = true,
CheckedIsValidOnly = true
};
c.PropertiesEdit.Assign(checkBoxSettings);
});
}).Bind(Model).GetHtml()