Excel filter no working with null values

Hello.


The Excel filter of one column doesn't work (it doesn't appear when you click on it) if there are any null value. For example, when the type is DateTime? and there are some rows with null values.


Thanks.


3 Replies 1 reply marked as answer

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team September 7, 2021 08:54 AM UTC

Hi Manuel, 

Greetings from Syncfusion Support. 

Query#:- The Excel filter of one column doesn't work (it doesn't appear when you click on it) if there are any null value. For example, when the type is DateTime?  
 
We have prepared sample using Excel Filter with DateTime column by setting Type property as datetime(with null values in it) but we are unable to replicate the problem at our end.  

Code below:- 
@(Html.EJ().Grid<OrdersView>("FlatGrid") 
        .Datasource((IEnumerable<object>)ViewBag.dataSource) 
        .AllowSorting() 
        .AllowPaging() 
            .AllowFiltering() 
            .FilterSettings(filter => { filter.FilterType(FilterType.Excel); }) 
            .Columns(col => 
            { 
                .   .   . 
               col.Field("OrderDate").HeaderText("Order Date").TextAlign(TextAlign.Right).Type("datetime").Priority(4).EditType(EditingType.DateTimePicker).Format("{0:MM/dd/yyyy hh:mm:ss}").Add(); 
                 
            })) 


 

Note:- We suspect that issue will occur when we bind empty dataSource for the first row of the Grid. When you bind the empty dataSource or null values Grid cannot find the actual data type of a column. In this case, you have to set the data type of the column explicitly to perform the Editing/Filtering and other Grid operations. Please ensure to add Type property for that column. 
 
If you are facing issue different from above mentioned share us the following details to find the cause of the issue.. 

  1. Complete Grid code example.
  2. Share Video Demo or Screenshot of Script Error(if any occurs) on console window.
  3. If possible replicate the issue in the above sample and revert us back.
  4. Have you faced the issue on Clicking the Excel Filter Dialog.

Regards, 
Farveen sulthana T 
 



MC Manuel Caballero September 7, 2021 09:50 AM UTC

Hello,


I have configured the column with  Type("datetime") and the filter works!!!


Thank you!!!


Marked as answer

PS Pon Selva Jeganathan Syncfusion Team September 8, 2021 11:07 AM UTC

Hi Manuel,  
   
Thanks for the update . 
 
We are glad to hear your query has been solved. 
 
Kindly get back to us for further assistance. We are happy to assist you. 

Regards, 
Pon selva 



Loader.
Up arrow icon