FilterType.Excel not working On Foreign Key Column

I want to use the "Text Filter Starts With" on the Foreign Key Column "Player".  My name "Larry White" is in the list, but the grid returns no rows when I type "Lar".  Same using "Contains".


Attachment: Points_39a8c176.zip

4 Replies

PS Prathap Senthil Syncfusion Team November 5, 2024 02:59 AM UTC

Hi Larry,

We are unable to reproduce the reported issue when attempting to reproduce the issue. For your reference, we have attached a simple sample and screenshot. To further address the reported problem, we require some additional clarification from your end. Please provide the details below to help us proceed:

  • To analyze the reported issue, could you please provide a simple and reproducible sample that demonstrates the problem? This will assist us in identifying the issue more efficiently and providing a resolution.
  • Could you please share us the video demonstrating of the issue replication Steps?
  • Alternatively, could you share your attempt to replicate the issue using the attached simple sample?

The information you provide will be very helpful in validating the reported query on our end and in providing a solution as quickly as possible. Thank you for your understanding.



Sample:
https://blazorplayground.syncfusion.com/embed/LXLTWMNzUHeMUZUL?appbar=true&editor=true&result=true&errorlist=true&theme=bootstrap5

Additionally, we noticed that you have enabled both paging and infinite scrolling features simultaneously. We would like to clarify that only one of these features should be used at a time, as this is the default behavior of the grid.

  <SfGrid DataSource="@FilteredPoints"

        Toolbar="@(new List<string>() {"Edit", "Delete", "Update", "Cancel", "Search"})"

       AllowPaging=true

        EnableStickyHeader=true

        AllowFiltering="true"

        AllowSorting="true"

        AllowResizing="true"

        AllowGrouping="true"

        EnableInfiniteScrolling="true"

        Height="400"

        RowHeight="20">

     

    <GridEditSettings AllowAdding="true"

                      AllowEditing="true"

                      AllowDeleting="true"

                      Mode=" Syncfusion.Blazor.Grids.EditMode.Normal"

                      ShowDeleteConfirmDialog="true"

                      ShowAddNewRow="true">

    </GridEditSettings>

 

    <GridGroupSettings

        EnableLazyLoading="true">

    </GridGroupSettings>

 

    <GridPageSettings PageSizes="false"

                      PageSize="100">

    </GridPageSettings>      


Regards,
Prathap Senthil



LA Larry November 5, 2024 04:28 PM UTC

I found the issue but do not know how to work around it.


FullName is a computed column.  When I change the foreign column to LastName, all of the filtering works as expected.


using System.ComponentModel.DataAnnotations;


namespace Golf.Quota.Models

{

    public class Player

    {

        public int Id { get; set; }

        [Required(ErrorMessage = "Last Name Is Required")]

        public string? LastName { get; set; }

        [Required(ErrorMessage = "First Name Is Required")]

        public string? FirstName { get; set; }

        public string FullName => $"{FirstName} {LastName}";

        public int GroupId { get; set; }

    }

}



LA Larry November 5, 2024 05:32 PM UTC

As a work around, I have added FullName to my SQL table as a computed column.  Now, it is being loaded from the db and the excel searching is working.



PS Prathap Senthil Syncfusion Team November 6, 2024 11:54 AM UTC

Based on your update, we suspect that the issue was caused by using 'FullName' as a computed column (template), which affected searching functionality. We are glad to hear that you have resolved the issue by updating the column name in the database. Please feel free to get back to us if you have any further questions.


Loader.
Up arrow icon