Hello,
I am using infragistics Grid in my UserControl. In the date Columns depending on the data the Column shows "1899-12-30". In this scenario I do not want to show anything and have the cell Empty. Is there a way to do this?
I tried using InitializeRow event handler to look for any date Values with this date, but if the set the value to nothing the value resets back to 01/01/0001. I am wondering if there is a way to accomplish this in a good way at Column level - like in BeforeColumnFormatting.
Any help is highly appreciated. Thanks.
-Saravanan.
Hi Saravanan,
DateTime fields in DotNot do not allow a value of null because DateTime is a struct. What kind of data source are you using for the grid? If you use a DataSource like a DataTable or UltraDataSource, then these data source will allow you to set a field to null regardless of the underlying data type. That would be the easiest way to do what you want.
Thanks for the reply Mike. I took another approach and solved the issue.
In the Grid's InitializeLayout I am checking for columns with DateTime dataType and setting a Custom DataFilter to the Column.Editor.DataFilter. Inside the DataFilter I included the logic to take care of the dates less than or equal to 1900.
That would have been my next suggestion - either a DataFilter or a DrawFilter. :)