We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

If grid has no data custom component in filter menu will not be rendered

Here is sample (copy/paste) from documentation page

@page "/"
@using Syncfusion.EJ2.Blazor.Grids
@using Syncfusion.EJ2.Blazor.DropDowns
    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)
    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.

2 Replies

AH Admir Hodžic January 29, 2020 03:21 PM UTC

Here is page file in txt, I do not know why I unable to post text with  markup in post

Attachment: Page_fb3ecb60.zip

RS Renjith Singh Rajendran Syncfusion Team January 30, 2020 12:51 PM UTC

Hi Admir, 

Thanks for contacting Syncfusion support. 

We are able to reproduce the reported issue at our end and we have confirmed it is bug. Thank you for taking the time to report this issue Problem with rendering FilterTemplate in an empty Grid” and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle ) and including the defect fix in our upcoming bi-weekly release which is expected to be rolled out on or before February 12, 2020.  
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.  

Query : I do not know why I unable to post text with  markup in post 
Currently we don’t have the option to display the code snippet in the website. We have already logged this requirement as a feature and this will be available in any of our upcoming website release. 
Please get back to us if you need further assistance. 

Renjith Singh Rajendran. 

Live Chat Icon For mobile
Up arrow icon