This question is locked. New answers and comments are not allowed.
Within the grid, is it possible to filter a DateTime type field on only the date part? If I enter (or select) or select 2/22/2012, it won't select it unless the time also matches. Is it possible to only do the date?
Thanks,
Matt
Thanks,
Matt
7 Answers, 1 is accepted
0
Dadv
Top achievements
Rank 1
answered on 28 Feb 2012, 02:45 PM
hi,
What are you using? custom binding (ajax or server) ?
What are you using? custom binding (ajax or server) ?
0
Matt
Top achievements
Rank 1
answered on 28 Feb 2012, 04:11 PM
I'm just binding it to the [View] Model, not using AJAX or anything.
0
Dadv
Top achievements
Rank 1
answered on 28 Feb 2012, 04:49 PM
If you use the inbuilt filter i don't know how to mach the clue because you send the column value.
But if you use some custom binding, you could intercept the filter date request, and change it like you want.
But if you use some custom binding, you could intercept the filter date request, and change it like you want.
0
Hi,
Atanas Korchev
the Telerik team
This can be achieved if you are using server binding. You need to bind to the Date property of your DateTime object:
columns.Bound(o => o.OrderDate.Date);
If you are using ajax binding however you need to implement custom binding as shown in this example.
Atanas Korchev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
0
Matt
Top achievements
Rank 1
answered on 07 Mar 2012, 04:37 PM
Hello,
When I do that, I get the following error when I try to filter on that column:
Thanks,
When I do that, I get the following error when I try to filter on that column:
The specified type member 'Date' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.
Thanks,
0
Hello,
Atanas Korchev
the Telerik team
This seems to be a limitation of Linq to Entities (it works without a problem when using Linq to SQL). In that case your only option is to implement custom binding.
Regards,Atanas Korchev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
0
Alex Smitt
Top achievements
Rank 1
answered on 03 Jul 2012, 08:16 PM
Instead of binding columns.Bound(o => o.OrderDate.Date);
try columns.Bound(o => o.OrderDate);
try columns.Bound(o => o.OrderDate);