DxDataGridCheckBoxColumn.ValueChecked Property

Specifies a value that corresponds to the checked state.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.1.dll

Declaration

[Parameter]
public object ValueChecked { get; set; }

Property Value

Type Description
Object

The value that corresponds to the checked state.

Remarks

Use the Field property to bind the checkbox column to a data source’s field. If the field has a predefined data type, field values define all column states: checked, unchecked, and (optionally) indeterminate. See Bind to Data for the complete list of predefined data types.

If the data field has a custom data type (Enum, Object, etc.), you should explicitly specify how to consider field values. To do this, use the following properties:

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

If a value is not equal to the specified properties, it is considered indeterminate.

The following example demonstrates how to bind the checkbox column to an Enum object:

<DxDataGrid Data="@Orders" ...>
    ...
    <DxDataGridCheckBoxColumn Field="@nameof(Order.OrderStatus)"
                              ValueChecked="@OrderStatus.Delivered"
                              ValueUnchecked="@OrderStatus.Processing"
                              ValueIndeterminate="@OrderStatus.InTransit"
                              Caption="Order Status">
    </DxDataGridCheckBoxColumn>
</DxDataGrid>
}

@code {
    IEnumerable<Order> Orders;

    protected override async Task OnInitializedAsync() {
        Orders = await OrderRepository.Load();
    }
}

DataGrid CheckBoxColumn CustomType

Run Demo: Data Grid - Filter Row

See Also