We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

EJ2 ASPNET CORE GRID Filter Issues

I am having considerable issues with the Grid Filter functionality, there are a couple of problems.

With the grid setup as below:

with these 2 fields:

        <e-grid-column field="ClientContactId"
                       headerText="Client"
                       dataSource="clients"
                       foreignKeyField="Id"
                       foreignKeyValue="Text">
        </e-grid-column>        
        <e-grid-column field="PersonnelKey"
                       headerText="Creator"
                       dataSource="employees"
                       foreignKeyField="Id"
                       foreignKeyValue="Text">
        </e-grid-column>


Problem:
With these two fields, the second field attempts to filter using the field name of the first, so the second of these columns PersonnelKey will send a ajax query to the server for filtered data but it uses the wrong field name ClientContactId instead of PersonnelKey
e.g.  https://localhost:5001/odata/invoiceheaders/?$count=true&$filter=((ClientContactId%20eq%2072))&$skip=0&$top=20

Sometimes the second field column refuses to send any ajax query at all to filter the table.  

But oddly if the fields are swapped in source code or at run time with column reordering the behavior changes, then the 1st column filters properly but the second column filters with the other columns field. The second column has the issue, irrespective of which column it is.

i.e. 
If ClientContactID is the first field, the PersonnelKey field has the problem,
If PersonnelKey is the first field, the ClientContactID field has the problem,
and the problem doesn't care if the order is changed via xaml source or by run time reordering.

I have attached the controller, the view, and the lookup object that is being used by ViewBag





-----------------------------------------------------------------


<ejs-grid id="Grid"
          allowExcelExport="true"
          allowPdfExport="true"
          allowResizing="true"
          allowReordering="true"
          allowGrouping="true"
          allowSorting="true"
          allowFiltering="true"
          allowPaging="true"
          enableAltRow="true"
          showColumnMenu="true"
          allowTextWrap="true"
          actionBegin="actionBegin"
          actionComplete="actionComplete"
          dataBound="dataBound"
          load="load"
          toolbarClick="toolbarClick"
          toolbar="@(new List<string>() {"Add", "Edit", "Delete", "Cancel", "Update", "ExcelExport", "PdfExport" })">
    <e-grid-groupsettings showGroupedColumn="true"></e-grid-groupsettings>
    <e-grid-pagesettings pageCount="5" pageSize="20" pageSizes="@(new string[] { "10", "20" , "100" })"></e-grid-pagesettings>
    <e-grid-editsettings mode="Dialog"
                         allowAdding="true"
                         allowEditing="true"
                         allowDeleting="true"
                         template="#editDialogTemplate"
                         showDeleteConfirmDialog="true"
                         showConfirmDialog="true">
    </e-grid-editsettings>
    <e-data-manager url="@odataUrl" adaptor="ODataV4Adaptor"></e-data-manager>
    <e-grid-columns>
        <e-grid-column field="InvoiceHeaderId"
                       isIdentity="true"
                       isPrimaryKey="true" 
                       visible="false">
        </e-grid-column>
        <e-grid-column field="InvoiceNumber"
                       headerText="Invoice #"
                       minWidth="100"
                       template="#invoiceLink">
        </e-grid-column>
        <e-grid-column field="CreationDate"
                       headerText="Date Created"
                       visible="false">
        </e-grid-column>
        <e-grid-column field="ClientContactId"
                       headerText="Client"
                       dataSource="clients"
                       foreignKeyField="Id"
                       foreignKeyValue="Text">
        </e-grid-column>        
        <e-grid-column field="PersonnelKey"
                       headerText="Creator"
                       dataSource="employees"
                       foreignKeyField="Id"
                       foreignKeyValue="Text">
        </e-grid-column>
        <e-grid-column field="Status"
                       headerText="Status">
        </e-grid-column>
        <e-grid-column field="ClientReference"
                       headerText="Client Reference"
                       visible="false">
        </e-grid-column>
        <e-grid-column field="SubmissionDate"
                       headerText="Date Submitted"
                       visible="false">
        </e-grid-column>
        <e-grid-column field="ClientMemo"
                       headerText="Extended Client Ref"
                       visible="false">
        </e-grid-column>
        <e-grid-column field="Memo"
                       headerText="Note to Client"
                       visible="false">
        </e-grid-column>
        <e-grid-column field="PrivateMemo"
                       headerText="Note to Acct"
                       visible="false">
        </e-grid-column>
        <e-grid-column field="AdditionalEmail"
                       headerText="Additional Emails"
                       visible="false">
        </e-grid-column>
        <e-grid-column field="InvoiceDate"
                       headerText="Date Invoiced">
        </e-grid-column>
    </e-grid-columns>
</ejs-grid>

Attachment: Source_f1be0c1d.zip

3 Replies

PS Pavithra Subramaniyam Syncfusion Team September 23, 2019 11:00 AM UTC

Hi Scott, 

Thanks for contacting Syncfusion support. 
 
We have validated the provided information and we already logged ForeignKey columns filtering is not working properly in remote data with same foreignKey field name” as a bug and the fix included in our Volume 2 SP1 Release so we suggest you to use the latest version(v.17.2.51) to resolve the problem. 
 
 
If you still face the problem then share the package version details that will helpful for us to validate further at our end. 
 
Regards, 
Pavithra S. 



SL Scott Lambert September 23, 2019 02:33 PM UTC


Thanks for your prompt reply. I am using the Nuget package Syncfusion.EJ2.AspNet.Core 17.2.0.51. I will change the Foreign Key name hopefully that will correct the issue.  I tried the link you gave and I get the following error page. 

Access Denied

This private feedback is not associated with your account.

If you believe that this error message is incorrect, please feel free to contact us



PS Pavithra Subramaniyam Syncfusion Team September 24, 2019 11:38 AM UTC

Hi Scott, 

Thanks for your update. 

We have created a sample with latest version, checked at our end and its working fine. Please refer the below sample for more information. 

 
Note: If possible then we suggest you to use different name for foreignKeyValue. 

We have added your ID in the feedback page. Now you can able to access it.  
 
Regards, 
Pavithra S. 


Loader.
Live Chat Icon For mobile
Up arrow icon