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

Filter doesn't work with GridDateTimeColumn

2 Answers 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Elliott
Top achievements
Rank 2
Elliott asked on 02 Jun 2011, 04:08 PM
I have a grid using a GridDateTimeColumn formatted from a stored procedure as mm/dd/yyyy.  The textbox alongside the DatePicker to filter zero supresses in the month and day so Equal To filtering doesn't work.  How do I fix this?
<telerik:GridDateTimeColumn UniqueName="ShipDate" DataField="ShipDate" PickerType="DatePicker" HeaderText="Ship Date" DataFormatString="{0:D}" CurrentFilterFunction="EqualTo" DataType="System.DateTime" FilterListOptions="VaryByDataType" >
</telerik:GridDateTimeColumn>
SELECT StoreNumber,
       AO.BoothNumber,
       AO.ItemID,
       ItemDescription,
       CONVERT(VARCHAR,ShipDate,101) AS ShipDate, .....

2 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 07 Jun 2011, 03:20 PM
Hello Marianne,

Note that when the ShipDate is convert to VARCHAR this is interpreted as string in C# and the column will be filtered by string and not by Date. Also please let me know if you set DataFormatString to mm/dd/yyyy the same problematic behavior appear. Please refer to the following help topic for additional information on similar scenarios:
http://www.telerik.com/help/aspnet-ajax/grid-filtering-for-griddatetimecolumn-with-dataformatstring.html



Best wishes,
Maria Ilieva
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.

0
Elliott
Top achievements
Rank 2
answered on 08 Jun 2011, 02:19 PM
thanks!
Tags
Grid
Asked by
Elliott
Top achievements
Rank 2
Answers by
Maria Ilieva
Telerik team
Elliott
Top achievements
Rank 2
Share this question
or