I populate the Grid with ~5000 results from a database. The Grid does the paging, sorting, and filtering in memory, except it won't filter for this one column that is a List<string> CustomerNamesList. I'm attempting to use the FilterMenuTemplate -- I just need a textbox and a dropdown like "Contains" and "Does Not Contain" but I can't figure out how to filter the Grid.
<GridColumn Field="@(nameof(CustomerNamesList))" Title="Customers" Sortable="false" Filterable="true">
<FilterMenuTemplate>
<label for="NameMenuFilter">Customer Name:</label>
<TelerikTextBox Id="NameMenuFilter" ValueChanged="@((value) => UpdateCustomerNameFilter(value))">
</TelerikTextBox>
</FilterMenuTemplate>
<Template>
@* display - loop thru List of customer names *@
</Template>
</GridColumn>
This code gets hit, but it's not doing anything...
public void UpdateCustomerNameFilter(string itemValue) { var filter1 = partyNamesFilterContext.FilterDescriptor.FilterDescriptors[0] as FilterDescriptor; filter1.Value = itemValue; filter1.Operator = FilterOperator.Contains; }
When I click Filter, it gives me a blazor.server.js error
Error: System.ArgumentException: Provided expression should have string type (Parameter 'stringExpression')
Update
Here's what I'm using as the datasource to make things clearer: IEnumerable<Companies>So what it appears to me is that the Grid doesn't know how to filter on a List of objects like this List<string>
public class Companies
{
public int Id {get; set;}
public List<string> CustomerNamesList {get; set;} = new List<string>();
// Other fields
}