Radzen DataGrid - Property is int, Context is string, Filter by Context

I have a column in a Radzen DataGrid which Property is integer, the content I display is of type string. Everything is displayed correct, but the filter only accepts integer values. How can I filter by the displayed content of type string:

<RadzenDataGridColumn TItem="Service" Width="60px" Property="ServiceType" Title="Service Type">
    <Template Context="context">
        @getServiceAsString(context.ServiceType)
    </Template>
</RadzenDataGridColumn>

These are the integer values and the corresponding string values
0: M1001
1: R2002
2: R2003
3: F3001
and so on

The easiest way will be to extend your model with new property which will be string representation of your int property and use this property for the column instead the original property.

Thanks for your fast reply.

There is no way to filter by the content of the column?

No, filtering is a data operation and cannot be performed on some content.

1 Like