Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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

C#
[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.

Razor
<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