blazor-devexpress-dot-blazor-dot-dxcheckbox-1-fc86293d.md
Specifies whether users can set the checkbox state to indeterminate.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
[Parameter]
public bool AllowIndeterminateStateByClick { get; set; }
| Type | Description |
|---|---|
| Boolean |
true allows users to select the indeterminate state; otherwise, false.
|
The DxCheckBox<T> component can have three states (checked, unchecked, and indeterminate) if the Checked property is bound to the String, Nullable Boolean or custom data type.
If the AllowIndeterminateStateByClick property is set to false (the default value), users can change checkbox states in the following order:
Indeterminate (default) → Checked → Unchecked → Checked → Unchecked.
Set the AllowIndeterminateStateByClick property to true to allow users to set the indeterminate state:
Indeterminate → Checked → Unchecked → Indeterminate.
<DxCheckBox @bind-Checked="@Value" AllowIndeterminateStateByClick="true">@GetText()</DxCheckBox>
@code{
bool? Value { get; set; }
string GetText() {
if (Value == true) return "Checked";
if (Value == false) return "Unchecked";
return "Indeterminate";
}
}
Note
The checkbox does not support the indeterminate state if the CheckType property is set to Switch or the AllowIndeterminateState is set to false. In this case, the indeterminate state is considered unchecked.
Run Demo: CheckBox - Customize Layout
See Also