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

Date filter

7 Answers 82 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 27 Aug 2009, 12:30 PM
Hi All,

I need some help with a date filter.  I want the filter to show a date field with picker.  Acceptable date format: dd/MM/yy.  When the user clicks to filter the EqualTo filter will be used.  I need the filter to work on a dd/MM/yy 00:00:00 - dd/MM/yy 23:59:59 basis and bring back the full day of matching figures - as it stands it would only bering back dd/MM/yy 00:00:00 which is about as useful as a chocolate teapot.

I've seen several similar posts but can't find anything that seems to make sense.  In the future please can the demo section on the site start to include these custom but very useful methods?  Searching through the forums is getting to be a very fustrating exercise.

Thanks in advance for any help,

Jon

7 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 31 Aug 2009, 10:26 AM
Hi Jon,

In order to filter date and time I suggest you use RadDateTimePicker inside RadGrid ItemTemplate.
More information about RadDateTimePicker is available here:
RadDateTimePicker server-side Events

All the best,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jon
Top achievements
Rank 1
answered on 02 Sep 2009, 08:53 AM
Hi Pavlina,

I'd prefer not to have the users have to set the time.  Is it possible to intercept the filter and apply it against a hidden column set to dd/MM/yy 00:00:00 - I'll get that column set in the SQL to strip out the time and replace with the 00:00:00.

The reason for this is that having to do the templates on so many different grids will be a pain in the neck.

I'd also like to request that this be a feature added into the next version of the grid - it seems from the forums that many people have the same issue.

Regards,

Jon
0
Pavlina
Telerik team
answered on 02 Sep 2009, 10:41 AM
Hi Jon,

For more information about how to implement date filters for column in the Grid using FilterTemplate, please refer to the following article:
Filter Templates

Sincerely yours,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jon
Top achievements
Rank 1
answered on 02 Sep 2009, 04:26 PM
Hi Pavlina,

Thanks but that is only of limited help.

The problem that I seem to be having is that when I use a custom filter then couple it with standard filters the standard filters interfere with the datatime filter and vice versa.

Could you provide me with an example of a grid where there is at least 1 column using standard filters and 1 column using a date filter on a column with times within it? 

There is a solution to my issue where I separate out the time to a second column but that looks amateur and in all honesty I'd have thought that the Telerik grid would be able to handle this simple and you'd have thought frequently arising scenario. 

Regards,

Jon
0
Pavlina
Telerik team
answered on 03 Sep 2009, 04:26 PM
Hi Jon,

At this point in order to progress in the resolution of this problem, it will be best if you open a formal support ticket and send me a small working project which would allow me to track the issue locally. Thus I could do all my best to help you in resolving it.
 
Sincerely yours,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
kachy
Top achievements
Rank 1
answered on 09 Apr 2010, 06:19 PM
Jon,

Were you able to solve this issue? I am trying to the same thing with my datetime field but could not find any solution yet. Any help would be greatly appreciated.


Thanks.
0
Jon
Top achievements
Rank 1
answered on 13 Apr 2010, 08:58 AM
Hi,

The solution that I used was to go for the two column approach.  In the stored procedure I cast the date as an NVARCHAR and also I output the proper date column.  Then in the datagrid the column that you use is both.  You use the NVARCHAR value as the display and filter value but the datetime column for the sort.  That way you can filter dates but also sort properly.  The downside is that say someone enters the date as 01/10 then they'd get everything for Jan 2010 and 1st October (all years).

Hope that helps.

Regards,

Jon
Tags
Grid
Asked by
Jon
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Jon
Top achievements
Rank 1
kachy
Top achievements
Rank 1
Share this question
or