Search not working when a date field is in the grid

I found this odd one - Search doesn't work when there is a Date field in the grid, for instance

                    <SfGrid ID="Grid2" AllowFiltering="false"
                            DataSource="@resources"
                            Toolbar="@(new List<string>() { "Search" })">
                        <GridPageSettings PageSize="12" PageSizes="true"></GridPageSettings>
                        <GridColumns>
                            <GridColumn Visible="editinggrid" Type="ColumnType.CheckBox" Width="20"></GridColumn>
                            <GridColumn Field=@nameof(ResourceForGridDTO.ResourceId) HeaderText="ID" IsPrimaryKey="true" Width="20"></GridColumn>
                            <GridColumn Field=@nameof(ResourceForGridDTO.Name) HeaderText="Name" Width="120"></GridColumn>
                            <GridColumn Field=@nameof(ResourceForGridDTO.ResourceDate) HeaderText="Resource Date" Width="60"></GridColumn>
                            <GridColumn Field=@nameof(ResourceForGridDTO.Size) AllowEditing="false" HeaderText="Size" Width="60"></GridColumn>
                        </GridColumns>
                    </SfGrid>

No results come back, no error either, just "No results found"

Please see video attached


Attachment: SyncFusionDateErrorSearch_a27b988.zip

3 Replies 1 reply marked as answer

KM Kuralarasan Muthusamy Syncfusion Team June 15, 2020 11:39 AM UTC

Hi John, 

Thanks for contacting Syncfusion support. 

We have tried to reproduce the problem by creating a sample based on the provided code. But the search action working fine even the Grid has a date field. We are attaching the sample for your convenience. Please download the sample from the link below, 


We need more details to further proceed on this and provide you a solution as early as possible, kindly get back to us with the following details for better assistance. 

  1. Share the sample Grid data source.
  2. Syncfusion package version.
  3. Share the details of the exception by using the OnActionFailure event, if its trigger.
  4. If possible, try to reproduce the reported issue in the attached sample and revert back to us.
  5. Share the console window, if you have facing any error.

Regards, 
Kuralarasan M 



JO John June 22, 2020 02:02 PM UTC

Thanks Kuralarasan 

I spent a good bit of time looking into this and can confirm your sample works well when the date is set to null in the model

  public class OrderDetails
    {
        public int? ResourceId { get; set; }
        public string Name { get; set; }
        public DateTime? ResourceDate { get; set; }
        public double Size { get; set; }
    }

But does not work when the date is not set to null

  public class OrderDetails
    {
        public int? ResourceId { get; set; }
        public string Name { get; set; }
        public DateTime ResourceDate { get; set; }
        public double Size { get; set; }
    }

I have attached a video demonstrating same

I look forward to your reply

Attachment: bandicam_20200622_155745678_5a14e266.zip


VN Vignesh Natarajan Syncfusion Team June 23, 2020 10:45 AM UTC

Hi John,  

Thanks for the update.  

Query: But does not work when the date is not set to null 
 
We have validated the defect you have initiated with us and we have confirmed it is a bug. Thank you for taking the time to report this issue “Searching is not working properly with DateTime object” and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle ) and including the defect fix in our weekly patch release which is expected to be rolled out on or before 15th July 2020. 
 
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. 


Till then we appreciate your patience. 

Regards, 
Vignesh Natarajan

Marked as answer
Loader.
Up arrow icon