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

DxCheckBoxSettings.AllowIndeterminateStateByClick Property

Specifies whether a click on the checkbox editor can switch it to the indeterminate state.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[DefaultValue(false)]
[Parameter]
public bool AllowIndeterminateStateByClick { get; set; }

#Property Value

Type Default Description
Boolean false

true if a click on the checkbox can switch it to the indeterminate state; otherwise, false.

#Remarks

A checkbox editor can be in checked, unchecked, and indeterminate states when the Grid or TreeList is in display mode. When these components are in edit mode, the indeterminate state is available only when the following conditions are met:

  • The checkbox is bound to a field whose data type differs from non-nullable Boolean.
  • The CheckType property of the checkbox is set to Checkbox (default value).

When a user switches between states, the checkbox skips the indeterminate state. Set the AllowIndeterminateStateByClick property to true to allow users to select the indeterminate state.

The following code snippet allows users to select the indeterminate state:

@inject ProductService ProductData

<DxGrid Data="@products" EditMode="GridEditMode.EditRow">
    <Columns>
        <DxGridCommandColumn />
        <DxGridDataColumn FieldName="ProductName" />
        <DxGridDataColumn FieldName="UnitPrice" />
        <DxGridDataColumn FieldName="UnitsInOrder" />
        <DxGridDataColumn FieldName="Discontinued">
            <EditSettings>
                <DxCheckBoxSettings AllowIndeterminateStateByClick="true" />
            </EditSettings>
        </DxGridDataColumn>
    </Columns>
</DxGrid>

@code {
    private Product[]? products;
    protected override async Task OnInitializedAsync() {
        products = await ProductData.GetData();
    }
}

To allow/prohibit users to/from switching the checkbox to the indeterminate state at runtime, use the ICheckBoxSettings.AllowIndeterminateStateByClick property.

See Also