i have an ultra grid and binding it to ultra data source having eight date columns and a date column can have an empty value so i am returning the date columns from the data base as strings. but when i am trying to sort it is sorting as a striring obviously. not able to convert an empty string to date time
I tried making the columns date and returned the date type columns from the database.
any ideas of how to sort a date column with empty values and the grid is read only
Thank you,
Vidya
Hi Vidya,
What kind of data source are you using?
I advise against storing dates as strings. This will cause problems in all sorts of areas like sorting, filtering, exporting, etc.
The DateTime data type cannot support nulls, but most data source will allow this without using a string. A DataTable, DataSet, or UltraDataSource will all allow you to use null or DBNull for a field value, even if the underlying type (DateTime) does not support it.
If you must use strings, then you can use the SortComparer property on the column to handle the sorting.
Hi I am in the same situation. I am using a collection of objects to bind to the WegDataGrid what have null values. We need to filter done on the DateTime data type and not on string comparison filtering. Can you please give a more clear resolution to this issue?