Skip to main content
A newer version of this page is available. .

DxCheckBox<T>.AllowIndeterminateStateByClick Property

Specifies whether users can set the checkbox state to indeterminate.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v20.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, and so on.

Set the AllowIndeterminateStateByClick property to true to allow users to set the indeterminate state:

Indeterminate -> Checked -> Unchecked -> Indeterminate, and so on.

<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. In this case, the indeterminate state is considered as unchecked.

Run Demo: CheckBox - Customize Layout

See Also