Here is sample (copy/paste) from documentation page
@page "/"
@using Syncfusion.EJ2.Blazor.Grids
@using Syncfusion.EJ2.Blazor.DropDowns
@code{
public List Orders { get; set; }
protected override void OnInitialized()
{
Orders = Enumerable.Range(1, 75).Select(x => new Order()
{
OrderID = 1000 + x,
CustomerID = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)],
Freight = 2.1 * x,
OrderDate = (new DateTime[] { new DateTime(2010, 5, 1), new DateTime(2010, 5, 2), new DateTime(2010, 5, 3), })[new Random().Next(3)],
})
.Where(x=> 1==2)
.ToList();
}
public class Order
{
public int? OrderID { get; set; }
public string CustomerID { get; set; }
public DateTime? OrderDate { get; set; }
public double? Freight { get; set; }
}
}
All I did is added extra where clue (Where(x=> 1==2)) for returning empty list.
When this page is rendered filter template for GridColumn OrderID is disabled, and user can't chuce filter anymore for this column.
(Strange behavior on grid is that FilterTemplate will be available if user filter some other column on grid).
Why it bothers me:
Because when user chooses "wrong" filter (filter which will return 0 records from data adapter) in column with Custom FilterTemplate implemented:
He lock out grid , he is no more able to change filter he set in column with custom filter template.
Additional info:
My grid using custom adapter so we can do where operations in sql ,
For that reason I want to have custom FilterTemplate items columns with values that does not exists in grid data.
But this opening solution to user pickup wrong combination of filters and get empty data for grid.