Setting the value of the GridFilterColumn to List<string> to apply the filter on load is not working. How to apply filtered column in Blazor DataGrid on load?

Answer:

There is no support to filter List values. So we suggest you to set the filtering value as string and provide those values as separate GridFilterColumn tags.


<GridFilterSettings Type="FilterType.Excel">

<GridFilterColumns>

<GridFilterColumn Field="CustomerID" MatchCase=false Operator="Operator.NotEqual" Predicate="and" Value="@FirstVal">GridFilterColumn>

<GridFilterColumn Field="CustomerID" MatchCase=false Operator="Operator.NotEqual" Predicate="and" Value="@SecondVal">GridFilterColumn>

GridFilterColumns>

GridFilterSettings>

@code{

public List Orders { get; set; }

public string FirstVal = "ANTON";

public string SecondVal = "ANANTR";

}




Loader.
Up arrow icon