Problem with filtering by date

Hello,
I have a column in a Data Grid of type "DateTime?". When I open a menu for filtering by this column, it shows icons for a calendar and a clock. When I press a clock-icon then I can select a time-value from a list. But when I press a calendar-icon then nothing happens except that it blinks indicating a click on it. I don't know why a calendar-selection is not displayed?

Then I tried to enter some date in various formats and the [HTTP_GET] in my WebApiAdaptor always gets the filer value as "(LastTest eq null)". A similar situation about type 'int?' and 'int'.
I get an event ActionFailureHandler with error described below.
Only columns with data type 'string' work as expected.
Could you please help me to make it working?

ActionFailureHandler args.Error:
{{
  "ClassName": "System.NullReferenceException",
  "Message": "Object reference not set to an instance of an object.",
  "Data": null,
  "InnerException": null,
  "HelpURL": null,
  "StackTraceString": "   at Syncfusion.Blazor.Data.WebApiAdaptor.ProcessResponse[T](Object data, DataManagerRequest queries)\r\n   at Syncfusion.Blazor.DataManager.ExecuteQuery[T](DataManagerRequest queries)\r\n   at Syncfusion.Blazor.DataManager.ExecuteQuery[T](Query query)\r\n   at Syncfusion.Blazor.Grids.SfGrid`1.GenerateAndExecuteQuery(Query query, Boolean foreignKeyHandle, Boolean isForeignKeyAction, Int32 VirtualStartIndex, Int32 VirtualEndIndex)\r\n   at Syncfusion.Blazor.Grids.SfGrid`1.DataProcess(ActionArgs action)",
  "RemoteStackTraceString": null,
  "RemoteStackIndex": 0,
  "ExceptionMethod": null,
  "HResult": -2147467261,
  "Source": "Syncfusion.Blazor",
  "WatsonBuckets": null
}}

3 Replies

VN Vignesh Natarajan Syncfusion Team April 13, 2020 09:13 AM UTC

Hi Andrzej,  
 
Thanks for contacting Syncfusion support.  
 
Query: “But when I press a calendar-icon then nothing happens except that it blinks indicating a click on it. I don't know why a calendar-selection is not displayed? 
 
We suspect that you are referring the old version scripts after updating to our latest version Nuget package. We are able to reproduce the reported at this scenario only. So kindly refer only the theme CSS file in your project. Refer our UG documentation for your reference 
 
 
Query: “Then I tried to enter some date in various formats and the [HTTP_GET] in my WebApiAdaptor always gets the filer value as "(LastTest eq null)" 
 
From your query we understand that you are facing issue while typing a value in DateTimePicker inside the Filter menu. Types value is sent as null. By format for DateTimePicker will be defined based on the GridColumn Format property. If GridColumn Format property is not defined, then by default “MM/dd/yyyy”, so if you type value other than this format value will be null. Reported issue will occur. So kindly share the following details to validate the reported query at our end.    
 
  1. Share Grid code example along with column definition.
  2. Share the details about the typed values (in DateTimePicker).
  3. Also ensure the reported issue by applying the above solution (to remove reference of unwanted scripts files).  
 
Regards, 
Vignesh Natarajan   
 



AN Andrzej April 15, 2020 08:56 AM UTC

Thanks for the support. The filter-dialog opens now the date-picker sends proper filter-parameter to WebApiAdapter. I added a following definition:


However one problem remains. When in any record a column of type "DateTime?" contains "null" then the filter dialog for this column doesn't open at all when I press a filter-icon. What could I do to make this working?

BTW: 1. The problem with null-value appears also in a sample EFGrid. 2. Sorting always works properly.


VN Vignesh Natarajan Syncfusion Team April 16, 2020 11:39 AM UTC

  
Hi Andrzej,  

Query: “When in any record a column of type "DateTime?" contains "null" then the filter dialog for this column doesn't open at all when I press a filter-icon. What could I do to make this working? 
 
As per your suggestion we have modified the WebAPI sample to return ”null” values for some of the records. We are not able to reproduce the reported issue at our end. Datepicker inside the Menu filter is getting open on clicking the icon without any error.  

Refer the below screenshot for your reference 

 
 

Note: last record in Grid is null value. But Datepicker is getting opened. 

If you are still facing the issue kindly share the video demonstration of issue along with issue reproducible sample. 

Regards, 
Vignesh Natarajan 


Loader.
Up arrow icon