DateTime column - managing NULL values

Hi,

I have an issue with the SfDataGrid control. Please, help me.

Background:
I need to show data from a database in a grid. One of the columns is type of DateTimeColumn. Sometimes data in this column have value of NULL. 
Using library version: 18.1460.0.42

Situation:
When data are loaded everything is fine. If datum in the column is NULL the field is empty (also If I set a value of NullValueText that text is displayed - but I did not find the functionality of NullValue property - everything I put in it nothing is changed).
But the problem happens when I want to order rows by this column. The exception happens saying that data for the comparising should be in DateTime type.

I see 2 possible solutions, but I am not able to implement any of them.

Solution 1:
Control should be changed anyway to support NULL value.

Solution 2:
In a database return data I can change the NULL value to any unreal datetime (like: 01.01.1850), but in this case this date is shown also on the screen. Need something that the library will use this unreal date for ordering, but will interpret it as NULL when it will be showing on the screen (empty or using NullValueText property)  

1 Reply

MA Mohanram Anbukkarasu Syncfusion Team May 19, 2021 11:29 AM UTC

Hi John,  
   
Thanks for contacting Syncfusion products.  
   
We are little unclear with the reported problem. We have prepared a sample using GridDateTimeColumn with null value. But unfortunately, we are unable to reproduce any exception while sorting.   
   
   
Please have a look at this sample and let us know if we have missed any customization you have done in your application or try to reproduce the reported issue in this sample and revert to us with the modified sample. It will be more helpful for us to find the exact cause for the issue and to provide a prompt solution at earlier.   
   
Regards,  
Mohanram A.  
  


Loader.
Up arrow icon