How to filter DateTime column only by date

4 posts, 1 answers
  1. Bibhudutta
    Bibhudutta avatar
    11 posts
    Member since:
    Jan 2012

    Posted 06 Feb 2012 Link to this post

    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" />

    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.

  2. Answer
    Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 06 Feb 2012 Link to this post

    Hello Bibhudutta,

    Please check below link.

    Jayesh Goyani
  3. DevCraft R3 2016 release webinar banner
  4. Inian
    Inian avatar
    3 posts
    Member since:
    Mar 2016

    Posted 23 Mar in reply to Jayesh Goyani Link to this post

    has no content.

  5. Kostadin
    Kostadin avatar
    1689 posts

    Posted 28 Mar Link to this post

    Hello Inian,

    You can find the same article in our new documentation.

    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top