This is a migrated thread and some comments may be shown as answers.

[Solved] FilterDescriptor is not filtering Dates correctly.

0 Answers 29 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Hemant
Top achievements
Rank 1
Hemant asked on 11 Mar 2011, 04:46 PM
I have following piece of code that is used to filter the data based on a start and end date (both inclusive).  When it is run with a Start Date of 3/9/11 and End Date of 3/10/11 it is expecetd to return a record that has a date of 3/10/11 but it is not.

 

 

 

 

GridCommand Command  and DateRange dateRange are  passed in to the function

 

 

 

 

var

 

 

filter = new CompositeFilterDescriptor();

 

 

filter.FilterDescriptors.Add(

 

new FilterDescriptor(member, FilterOperator.IsGreaterThanOrEqualTo, dateRange.Start));

 

 

filter.FilterDescriptors.Add(

 

new FilterDescriptor(member, FilterOperator.IsLessThanOrEqualTo, dateRange.End));

 

 

Command.FilterDescriptors.Add(filter);

The Filter defaults to AND condition. (Which I confirmed by watching the Composite Filter's properties).

Is this a known Bug in Telerik Grid/Filter or I am missing something?

3/9/11 and 3/10/11 does not work.
3/10/11 and 3/10/11 does not work
3/10/11 and 3/11/11 works.
3/9/11 and 3/11/11 works.

Looks like IsLessThanOrEqualTo Operator does not work as expected?


Hemant

Tags
Grid
Asked by
Hemant
Top achievements
Rank 1
Share this question
or