DataGrid OData filter does not detect correct data type

Hi.

I have create an OData endpoint and want to show that data in a datagrid. This works, the data is shown and sorting of instance if working. What is not working is the detection of the datatype of a certain colomn when the data is a string or guid. So I get integer options (larger then, etc) instead of the "start with etc" options.

How can I make sure that the datagrid is showing me the correct filter options. I already tried to find the solution in the demo page and in the api documentation but I was unable to find the solution there.

The code is

<RadzenDataGrid @ref="grid" IsLoading="@isLoading" Count="@count" Data="@alerts"
                LoadData="@LoadData" FilterPopupRenderMode="PopupRenderMode.OnDemand" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
                FilterMode="FilterMode.Advanced" AllowSorting="true" AllowFiltering="true" AllowPaging="true" PageSize="15"
                PagerHorizontalAlign="HorizontalAlign.Center">
    <Columns>
        <RadzenDataGridColumn Property="@nameof(Alert.GUID)" Title="Identifier" Width="260px" TextAlign="TextAlign.Left" />
        <RadzenDataGridColumn Property="@nameof(Alert.Message.Message)" SortProperty="Message.Message" Title="Message" TextAlign="TextAlign.Left">
            <Template Context="alert">
                <RadzenText>@alert.Message.Message</RadzenText>
            </Template>
        </RadzenDataGridColumn>
        <RadzenDataGridColumn Property="@nameof(Alert.ReceivedOn)" Title="Received on" Width="200px" TextAlign="TextAlign.Left" />
    </Columns>
</RadzenDataGrid>

The following images show that we do not have the start with/end with options as expected for a string (and is available in the odata demo)

image

Greetings,

Vincent

You can try to set Type="typeof(string)" for this column.

1 Like