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

Enable EnableRangeFiltering With Programmatic Client Side Binding

1 Answer 57 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Roberto
Top achievements
Rank 1
Roberto asked on 04 Jan 2021, 08:01 PM
I'm using https://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/client-side/programmatic/defaultvb.aspx?show-source=true as an example for client side binding, however for columns with datetime data type I can't get the filter to work properly when EnableRangeFiltering is enabled. Does anyone have an example to make the BuildParameter correct, in which case GridKnownFunction.Between is used and the values are passed in expression.FieldValue separated by space. Example: "01/01/2021 07/01/2021". Thanks

1 Answer, 1 is accepted

Sort by
0
Attila Antal
Telerik team
answered on 24 Feb 2021, 12:27 PM

Hi Roberto,

To get the best out of RadGrid, we recommend binding data to it using the RadClientDataSource. (you can download the attached Sample project and test it right away)

Configuration Specifics

Creating the data source for the Grid would have a Field of type DateTime.

 

 

Add a ModelFIeld to RadClientDataSource Schema specifying the Field DataType as Date

 

Create a GridDateTimeColumn for the Grid and set its DataField to point to that field in the data source. Also, you may want to format the Date using the DataFormatString and enable range filtering through the EnableRangeFiltering property.

 

Results

RadGrid with no filtering applied

 

RadGrid with Date Filtering applied, between 01/3/2021 and 10/03/2021

 

Regards,
Attila Antal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Roberto
Top achievements
Rank 1
Answers by
Attila Antal
Telerik team
Share this question
or