What is required to filter a grid on a DateTime without specifying the time? i.e.: I want to see all records for a date. All for 2022-05-18 regardless of the time.
Or do you have to specify the date using identifying greater than and less than? i.e.: > 2022-05-17 and < 2022-05-19
1 Answer, 1 is accepted
0
Mihaela
Telerik team
answered on 24 May 2022, 12:11 PM
Hi Taras,
You could achieve the desired result as per the following approach:
Create a Model property which contains only the date portion of the datetime value:
publicclassGridViewModel
{
public DateTime? OrderDate { get; set; }
public DateTime? OrderDateNoTime { get; set; } //Only Date without the time portion
}
Bind the Grid column to the newly created field and use the ClientTemplate() option to display the datetime field instead. As a result, the Grid data will be filtered by "OrderDateNoTime" while displaying the original datetime field "OrderDate".
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/.