Skip to main content

DxCheckBoxSettings.ValueIndeterminate Property

Specifies the value that corresponds to the checkbox editor’s indeterminate state.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(null)]
[Parameter]
public object ValueIndeterminate { get; set; }

Property Value

Type Default Description
Object null

The value that corresponds to the checkbox editor’s indeterminate state.

Remarks

For predefined data types, a checkbox automatically defines the values that correspond to checked, unchecked, and indeterminate states. If a checkbox editor is bound to a custom data type, you should explicitly specify values that correspond to each checkbox state. Refer to the following topic for more information: Change a Column Editor to Checkbox.

Set the following properties to display a checkbox editor for a column bound to a custom data type:

ValueChecked
Specifies the value that corresponds to the checked state.
ValueIndeterminate
Specifies the value that corresponds to the indeterminate state.
ValueUnchecked
Specifies the value that corresponds to the unchecked state.

All other values correspond to the indeterminate state of the checkbox. If the CheckType property is set to Switch and the indeterminate state is unavailable, such values correspond to the unchecked state.

The following code snippet configures a checkbox bound to an Enum object:

@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 ValueChecked="@State.Yes"
                                    ValueUnchecked="@State.No"
                                    ValueIndeterminate="@State.Unknown" />
            </EditSettings>
        </DxGridDataColumn>
    </Columns>
</DxGrid>

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

Specify the following properties to customize display text strings that correspond to checkbox states:

To change the value that corresponds to the indeterminate state at runtime, use the ICheckBoxSettings.ValueIndeterminate property.

Implements

See Also