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

How to filter DateTime column only by date

3 Answers 412 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bibhudutta
Top achievements
Rank 1
Bibhudutta asked on 06 Feb 2012, 09:05 AM
I have a column in grid which is of " DateTime " data type. I have default filtering set ON for the grid and the code for the column goes like this :
                    <telerik:GridBoundColumn UniqueName="OrderDate" DataField="OrderDate" HeaderText="Ordered on"
                        CurrentFilterFunction="EqualTo" ShowFilterIcon="False" AutoPostBackOnFilter="True"
                        DataFormatString="{0:MM/dd/yy}" DataType="System.DateTime">
                        <ItemStyle HorizontalAlign="Right" />
                        <HeaderStyle HorizontalAlign="Right" Width="65px" />
                    </telerik:GridBoundColumn>

And the grid is showing all the columns perfectly as expected. For the above code the grid shows only the date in the column but not the time. But, I want to filter the column only by date and not by date time. As when I serach only by date, the filter results with no records for a particular date, as the time(for the provided date) does not match when I do not provide it(I think it takes the default time "00:00:00.000"). I am unable to achieve this. Please help me out.

Thanks.

3 Answers, 1 is accepted

Sort by
0
Accepted
Jayesh Goyani
Top achievements
Rank 2
answered on 06 Feb 2012, 10:06 AM
Hello Bibhudutta,

Please check below link.
http://www.telerik.com/help/aspnet/grid/grdfilteringfordatetimecolumnwithdataformatstring.html

Thanks,
Jayesh Goyani
0
Inian
Top achievements
Rank 1
answered on 23 Mar 2016, 01:57 PM

http://www.telerik.com/help/aspnet/grid/grdfilteringfordatetimecolumnwithdataformatstring.html

has no content.

0
Kostadin
Telerik team
answered on 28 Mar 2016, 06:52 AM
Hello Inian,

You can find the same article in our new documentation.

Regards,
Kostadin
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Grid
Asked by
Bibhudutta
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Inian
Top achievements
Rank 1
Kostadin
Telerik team
Share this question
or