Search Blazor grid with foreign key value

Hi,

When using a foreign key column in a Blazor grid, the search function does not work. If I remove the reference to the foreign key column then the search function works fine.

I am using Blazor Server Side with Version 18.1.0.42 and a UrlAdaptor to access data for a grid using EF Core from an Azure SQL Server. I am adding a foreign key from the following list.

    List<ExchangeRate> exhangeRates { get; set; }
    protected override async Task OnInitializedAsync()
    {
        using var db = new SkyNetContext();
        exhangeRates = await db.ExchangeRates
            .ToListAsync();
    }

This is the grid columns specification showing the foreign key field and value are as follows.

    <GridColumns>
        <GridColumn Field=@nameof(Supplier.SupplierId) IsPrimaryKey="true" IsIdentity="true" Visible="false"></GridColumn>
        <GridColumn Field=@nameof(Supplier.Name) HeaderText="Name" Type="ColumnType.String"></GridColumn>
        <GridColumn Field=@nameof(Supplier.ExchangeRateId) HeaderText="Exchange Rate" ForeignKeyField=@nameof(ExchangeRate.ExchangeRateId) ForeignKeyValue=@nameof(ExchangeRate.Name) DataSource=@exhangeRates></GridColumn>
        <GridColumn Field=@nameof(Supplier.LastUpdated) HeaderText="Updated" Format="dd/MM/yyyy" Type="ColumnType.DateTime" EditType="EditType.DatePickerEdit"></GridColumn>
    </GridColumns>

Can you let me know how to search with a foreign key column in a Blazor grid?

Kind regards,
Stuart

5 Replies

VN Vignesh Natarajan Syncfusion Team April 10, 2020 09:02 AM UTC

Hi Stuart,  
 
Thanks for contacting Syncfusion support.  
 
Query: “When using a foreign key column in a Blazor grid, the search function does not work 
 
Currently we do not have support to perform search operation in ForeignKey column. Since it is a known request we have considered it a feature. “Search support for ForeignKey Column” has been added it to our feature request list. 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.. It will be implemented in any of the upcoming releases.  
 
The status of implementation can be tracked through our feedback link 
 
 
Till then you can perform search operation in other columns (ignoring the foreignkey column) by using the below documentation to perform search in specific columns.  
 
 
Kindly get back to us if you have further queries.

 
Regards, 
Vignesh Natarajan. 



ST Stuart April 11, 2020 01:44 AM UTC

Hi Vignesh,

Thanks for the update on this, I'll work around this for now.

I appreciate your support.

Kind regards,
Stuart


RS Renjith Singh Rajendran Syncfusion Team April 13, 2020 04:16 AM UTC

Hi Stuart, 

Thanks for your update. 

As promised we will implement this in our upcoming release. 

Until then we appreciate your patience. 

Regards, 
Renjith Singh Rajendran. 



BU Budi August 13, 2020 07:23 AM UTC

Hi Renjith,

A am using Blazor server side with version 18.2.0.48, but still face the problem with search function if there is a foreign key column in a Blazor grid.

Any updates please..?

regards,
Budi S.


RS Renjith Singh Rajendran Syncfusion Team August 14, 2020 09:59 AM UTC

Hi Budi, 

Sorry for the inconvenience caused. 

We have planned to include the fix for this issue in our upcoming bi-weekly release which is expected to be rolled out by the end of September 2020. 

You can track the status of implementation through the below feedback link,  

Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran 


Loader.
Up arrow icon