RadGrid DateTime Column Filter

2 posts, 0 answers
  1. Sandeep
    Sandeep avatar
    22 posts
    Member since:
    Apr 2013

    Posted 24 Nov 2016 Link to this post

    Hi Team,

    I have a Radgrid which has DateTime Column with enable range filter. I am using AllowCustomPaging="True" And I am displaying the date as "24/11/2016 15:31:15" and I want that when I choose from date and To date the filter expression should format the filter date.

    For example From date is "23/11/2016" and To Date is "24/11/2016" then it should change to "20161123" and "20161124" before passing to database.

    Could you please help me on this.

    ~

    Sandeep

  2. Vasil
    Admin
    Vasil avatar
    1635 posts

    Posted 29 Nov 2016 Link to this post

    Hello Sandeep,

    The filters inside the DataTameColumns are RadDateTimePickers that works with Date objects. You can handle the Grid's ItemCommand event, use these values to create your custom expressions with custom formatted string representation of the given Date objects.
    Further information about custom filtering can be found in our documentation:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/how-to/Filtering/custom-option-for-filtering
    http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/how-to/Filtering/custom-filter-options-with-handling

    And live example with it's code here (look for the code of OrderDate column):
    http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/filtering/filter-templates/defaultcs.aspx

    Regards,
    Vasil
    Telerik by Progress
    Telerik UI for ASP.NET AJAX is ready for Visual Studio 2017 RC! Learn more.
Back to Top