<telerik:GridDateTimeColumn datafield="ExportedDate" DataFormatString="{0:MM/dd/yyyy}" datatype="System.DateTime"
headertext="Exported" sortexpression="ExportedDate" uniquename="EXPORTED" FilterControlWidth="75px">
<HeaderStyle HorizontalAlign="Center" Width="90px"/>
<ItemStyle HorizontalAlign="Right" Width="90px"/>
</telerik:GridDateTimeColumn>
What I have found is that the date will not work correctly on fields unless the data coming from the database has the time essentially set to 00:00:00. All the filtering is done by the specified date with the time set to midnight.
For example: if my date field from the database is 3/25/2009 06:30:12 and I'm filtering on the date 3/25/2009, then the following results ocurr:
Comparison Expected Result Actual Result
-------------------------- ----------------------- --------------------
EqualTo Match No match
NotEqualTo No Match Match
GreaterThan No Match Match
LessThan No Match No Match
GreaterThanOrEqualTo Match Match
LessThanOrEqualTo Match No Match
As you can see, only 2 comparisons return results as expected. It all stems around the issue with the time component being used in the comparison.
Work arounds include adding custom filtering, changing every database access procedure or call to remove the time component in the results, and limiting the filter functions to only what works.
None are very attractive when considering the extent of work involved. This system that the Telerik controls are used was initially developed 10 years ag0 and has grown to have at one site alone, 300,000 registered users, hundreds of web pages, thousands of queries, and, needless to say, an extremely large amount of accumulated data.
I believe I shouldn't have to add code to make the date filter work as logically expected. The filtering logic should automatically strip off the TimeOfDay and not be used in the comparisons. Because the System.DateTime has a resolution down to the milliseconds, anyone searching for any equality based on the date will not find a match. This is especially true when picking a date from the calendar icon or when typing in a date; you do not specifiy the time and it is implied to be midnight.
Any assistance, comments, or improvements is greatly appreciated.
Ed Lamprecht