Grid with FilterType.Menu filtering on dateTime column does not work
|
<SfGrid @ref="Grid" DataSource="@GridData" AllowPaging="true" AllowSelection="true" AllowSorting="true" AllowFiltering="true" AllowResizing="true" Height="600" RowHeight="38">
<GridPageSettings PageSize="50" PageCount="5"></GridPageSettings>
<GridEvents OnRecordDoubleClick="RecordDoubleClickHandler" TValue="TrialRequestDto"></GridEvents>
<GridFilterSettings Type="Syncfusion.Blazor.Grids.FilterType.Menu"></GridFilterSettings>
<GridColumns>
<GridColumn Field=@nameof(TrialRequestDto.Trainer) HeaderText="Trainer" Type="ColumnType.String"></GridColumn>
<GridColumn Field=@nameof(TrialRequestDto.Description) HeaderText="Description" Type="ColumnType.String"></GridColumn>
<GridColumn Field=@nameof(TrialRequestDto.RequestDate) HeaderText="RequestDate" Format="d" Type="ColumnType.Date" TextAlign="TextAlign.Right"></GridColumn>
<GridColumn Field=@nameof(TrialRequestDto.ScheduledDate) HeaderText="ScheduledDate" Format="d" Type="ColumnType.Date" TextAlign="TextAlign.Right"></GridColumn>
</GridColumns>
</SfGrid>
@code{
protected override void OnInitialized()
{
GridData = Enumerable.Range(1, 75).Select(x => new TrialRequestDto()
{
TrialRequestId = 1000 + x,
Trainer = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)],
Description = (new string[] { "ALFKI1", "ANANTR1", "ANTON1", "BLONP1", "BOLID1" })[new Random().Next(5)],
ScheduledDate = (new DateTime[] { new DateTime(2020,11, 1), new DateTime(2020, 11, 2), new DateTime(2020, 11, 3), })[new Random().Next(3)],
RequestDate = (new DateTime[] { new DateTime(2020, 10, 1), new DateTime(2020, 10, 2), new DateTime(2020, 10, 3), })[new Random().Next(3)],
LastUpdateDate = (new DateTime[] { new DateTime(2020, 9, 1), new DateTime(2020, 9, 2), new DateTime(2020, 9, 3), })[new Random().Next(3)],
}).ToList();
}
|
|
<SfGrid @ref="Grid" DataSource="@GridData" AllowPaging="true" AllowSelection="true" AllowSorting="true" AllowFiltering="true" AllowResizing="true" Height="600" RowHeight="38">
<GridPageSettings PageSize="50" PageCount="5"></GridPageSettings>
<GridEvents OnRecordDoubleClick="RecordDoubleClickHandler" TValue="TrialRequestDto"></GridEvents>
<GridFilterSettings Type="Syncfusion.Blazor.Grids.FilterType.Menu"></GridFilterSettings>
<GridColumns>
<GridColumn Field=@nameof(TrialRequestDto.Trainer) HeaderText="Trainer" Type="ColumnType.String"></GridColumn>
<GridColumn Field=@nameof(TrialRequestDto.Description) HeaderText="Description" Type="ColumnType.String"></GridColumn>
<GridColumn Field=@nameof(TrialRequestDto.RequestDate) HeaderText="RequestDate" Format="d" FilterSettings="new FilterSettings() { Type = FilterType.CheckBox }" Type="ColumnType.Date" TextAlign="TextAlign.Right"></GridColumn>
<GridColumn Field=@nameof(TrialRequestDto.ScheduledDate) HeaderText="ScheduledDate" Format="d" Type="ColumnType.Date" TextAlign="TextAlign.Right"></GridColumn>
</GridColumns>
</SfGrid>
|
So, how to filter date only? how to ignore the time?
Hi Rafa,
We have considered it as a usability improvement and
logged a task “Converting DateOnly type to DateTime type in Blazor
grid”.
At the planning stage for every release cycle, we review
all open features and identify features for implementation based on specific
parameters including product vision, technological feasibility, and customer
interest. And this improvement will be included in any of our upcoming releases.
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.
https://www.syncfusion.com/feedback/36025/converting-dateonly-type-to-datetime-type-in-blazor-grid
You can also communicate with us regarding the open feature any time using our above feedback report page. We do not have immediate plan to implement this feature and it will be included in any of our upcoming releases. Please cast your vote to make it count. So that we will prioritize the improvement for every release based on demands.
Regards,
Naveen Palanivel
Until version 21.1.35 we didn't find support for this demand. It is not possible to filter records in a grid by the date/time field only by the date, disregarding the time part.
Hi Mauri
We checked your query, we would like to inform that we have provided support for dateonly and timeonly in oru 2023 volume 1 release .before proceeding further with your requirement kindly share the below details to validate further at our end.
- Could you please explain about your requirement that if you want to filter Date only in DateTime Object,
- Could please share a screenshot or video demo what you are excepting it is very useful to us.
The above-requested details will be very helpful for us to validate the reported query at our end and provide the solution as early as possible.
- 11 Replies
- 6 Participants
- Marked answer
-
FT Florin Talos
- Nov 3, 2020 07:47 PM UTC
- Apr 10, 2023 08:45 PM UTC