Filtering Date does not work

Dear support, I have a grid with filtering enabled as the code below

I want to be able to filter by date but it seems when i type to filter textbox, e.g. 22/06/2021 it does not filter at all.

can you please provide the Code Snipet to make that work ?

than

******

 <GridFilterSettings Mode="FilterBarMode.Immediate" ImmediateModeDelay="700"></GridFilterSettings>


<GridColumn Field=@nameof(MyApp.Model.VisitActivity.ExamDate) HeaderText="ExamDate" Format="dd/MM/yyyy" Type="ColumnType.DateTime" TextAlign="TextAlign.Left" AutoFit="true"> </GridColumn>


1 Reply

RS Renjith Singh Rajendran Syncfusion Team June 23, 2021 10:48 AM UTC

Hi Danil, 

Greetings from Syncfusion support. 

Based on this scenario, we suggest you to render a SfDatePicker using FilterTemplate feature of grid to filter the date column. 
Reference :  

You can handle the filtering action using FilterByColumn method in the ValueChange event of SfDatePicker. We have also prepared a sample based on this scenario for your convenience, please download the sample from the link below, 
 
Please refer the codes below, 

<GridColumn Field=@nameof(Order.OrderDate) HeaderText=" Order Date" Format="dd/MM/yyyy" Type="ColumnType.DateTime" TextAlign="TextAlign.Right" Width="130">    <FilterTemplate>        <SfDatePicker TValue="DateTime?" Format="dd/MM/yyyy" Placeholder='Select a date'>            <DatePickerEvents TValue="DateTime?" ValueChange="FilterDateColumn"></DatePickerEvents>        </SfDatePicker>    </FilterTemplate></GridColumn>SfGrid<Order> Grid;public async Task FilterDateColumn(ChangedEventArgs<DateTime?> args){    await Task.Delay(700);    if (args.Value != null)    {        await Grid.FilterByColumn("OrderDate""equal", args.Value, nulltrue);    }    else    {        await Grid.ClearFiltering("OrderDate");    }}

Please get back to us if you need further assistance. 

Regards, 
Renjith R 


Loader.
Up arrow icon