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

Date Time Col Doesnt Find Date in Timestamp

4 Answers 215 Views
Grid
This is a migrated thread and some comments may be shown as answers.
bradley baker
Top achievements
Rank 1
bradley baker asked on 26 Oct 2009, 04:34 PM
Using a GridDateTimeColumn for a timestamp field and I want the users to be able to search the dates IE "10-25-2009" but because its a timestamp field "2009-10-25 12:12:01"  it never seems to find any results even though there are records for the dates.  How do I resolve this?

4 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 29 Oct 2009, 09:01 AM
Hi bradley,

In order to make this work, there are two options. You can either enter the whole value (like 2009-10-25 12:12:01), or you need to have a separate field, containing only the date, in the underlying datasource, which would allow you to subsequently only enter the date. Other than this, there is no other option to handle this automatically.
Yet another alternative would be to intercept the filter command, and alter the user input, for example by adding the hour part, to get a full timestamp value.
I hope this information helps.

Greetings,
Yavor
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
VIRUX
Top achievements
Rank 1
answered on 17 Sep 2010, 09:41 AM
Hello Telerik,

Can I get demo application , an easier way pls...
Even "Contain" filter on datetime bound column is not working ...
Now what I do is just bind to string bound column and filter with "contain"
Intercepting the filter command needs much effort and it should not be that difficult :(
Thanks
0
Martin
Telerik team
answered on 23 Sep 2010, 11:22 AM
Hello VIRUX,

I am afraid that the options described by my colleague Yavor are the only ones that are currently available. If you face any problems implementing any of the approaches above, you can open a formal support ticket and send us a small sample demonstrating your scenario. This way we will be able to debug it locally and provide you with more to the point resolution.

I hope this helps.
Martin
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Mihai Dinculescu
Top achievements
Rank 1
answered on 29 Nov 2011, 04:51 PM
I apologize for resurrecting this thread but because the problem still exists I'd like to post the following solution which I found to be easiest. Yavor hinted it too but not in a very explicit manner.

The solution is to strip down the hour, minutes, seconds from the Date field used to populate the data.

For example if you bind from a LINQ datasource you can do the following:
from _r in dc.Orders
select new
{
_r.OrderDate.Value.Date,
}
Tags
Grid
Asked by
bradley baker
Top achievements
Rank 1
Answers by
Yavor
Telerik team
VIRUX
Top achievements
Rank 1
Martin
Telerik team
Mihai Dinculescu
Top achievements
Rank 1
Share this question
or