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

RadGrid DateTime Column Filter

1 Answer 202 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sandeep
Top achievements
Rank 1
Sandeep asked on 24 Nov 2016, 02:43 PM

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

1 Answer, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 29 Nov 2016, 11:33 AM
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.
Tags
Grid
Asked by
Sandeep
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Share this question
or