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>.AllowIndeterminateState Property

Specifies whether the CheckBox supports the indeterminate state.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[DefaultValue(true)]
[Parameter]
public bool AllowIndeterminateState { get; set; }

#Property Value

Type Default Description
Boolean true

true if the check mark can be set to 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. The indeterminate state is activated when the bound variable value is null. To allow users to activate the indeterminate CheckBox state by a click, set the AllowIndeterminateStateByClick property to true.

The following example activates the CheckBox’s indeterminate state in code:

Razor
<DxCheckBox @bind-Checked="@Value">CheckBox Item</DxCheckBox>
<DxButton Click="(e) => ChangeCheckBoxState()">Set to NULL</DxButton>

@code {
    bool? Value = true;
    void ChangeCheckBoxState() {
        Value = null;
    }
}

If the CheckBox bound value has the Nullable Boolean, String, or custom data type, and the AllowIndeterminateState property is set to false, the indeterminate state is not allowed. The CheckBox always skips the indeterminate state when a user switches between checked and unchecked states, and the AllowIndeterminateStateByClick property has no effect.

Razor
<DxCheckBox @bind-Checked="@Value" AllowIndeterminateState="false">CheckBox Item</DxCheckBox>
<DxButton Click="(e) => ChangeCheckBoxState()">Set to NULL</DxButton>

@code {
    bool? Value = true;
    void ChangeCheckBoxState() {
        Value = null;
    }
}

Run Demo: CheckBox - Overview

See Also