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

Date filtering in radgrid not working...

3 Answers 394 Views
Grid
This is a migrated thread and some comments may be shown as answers.
suresh
Top achievements
Rank 1
suresh asked on 02 Aug 2011, 12:38 PM
Hi,

I have a column in my table which consists of both date and time.

when i am filtering that column in a radgrid it is filtring the values only whose time is equal to 12:00AM.

scenario:My column values are like
 12-Jul-2011 11:20PM
12-Jul-2011 12:00AM
12-Jul-2011 08:15AM

when i am filtering with 12-jul-2011 in radgrid it is dsiplaying only 2nd row("12-Jul-2011 12:00AM") and first and third rows are being neglected

Any pointers to solve this problem will be of great help.

3 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 02 Aug 2011, 12:51 PM
Hello suresh,

RadGrid not handle this thing.You have to do it manually.Please follow below link.

grid filtering for datetime column with dataformatstring

Thanks,
Jayesh Goyani
0
suresh
Top achievements
Rank 1
answered on 03 Aug 2011, 10:59 AM
Hi Jayesh,

Thanks alot for your prompt reply.

I had already gone through the link which you supplied and the problem is when ever you do it manually remaining column filters will not work and also when other column filters are applied date column filtering will not work.
0
Tsvetina
Telerik team
answered on 08 Aug 2011, 12:36 PM
Hello Suresh,

Indeed, the behavior which you mentioned is observed. However, it is expected. When the filtering is performed, it tries to match the complete value, against whatever value is present in the database. Hence, if there is a "11/3/2009 12:00 AM" value in the database, the filter value should match this value.

To achieve filtering based only on date and if the time is not important for further filtration, you can easily convert the datetime field into a date and return it as a date type only. The framework will convert it to a DateTime type, but in this case the time will be set to midnight.

A project which shows how you could accomplish this task is attached to this post (see the SELECT query for details).

Regards,
Tsvetina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
suresh
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
suresh
Top achievements
Rank 1
Tsvetina
Telerik team
Share this question
or