Skip to main content

DxCheckBox<T>.AllowIndeterminateStateByClick Property

Specifies whether users can set the checkbox state to indeterminate.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public bool AllowIndeterminateStateByClick { get; set; }

Property Value

Type Description
Boolean

true allows users to select the indeterminate state; otherwise, false.

Remarks

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";
    }
}

CheckBox Three States

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