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

Foreign Key Column AutoComplete Filter in Data Grid

Hello, Team

In my application I have Server side grid with Filter Menu. 

Now I have one foreign Key column in that when we are filtering there are no suggestion like this. 

https://s3.amazonaws.com/files2.syncfusion.com/dtsupport/kb/js/js-23170/js-23170_img1.png

Other than that every column working fine. So how can we achieve this functionality 

Thanks. 


3 Replies

RS Rajapandiyan Settu Syncfusion Team October 19, 2022 12:34 PM UTC

Hi Hiral,


Thanks for contacting Syncfusion support.


Query: I have a few columns that I would like to autofit, and I have one column that I would like to take the remaining space.


We have prepared a simple sample with ForeignKey feature in EJ2 Grid. The filtering action is working fine with foreignkey column. Find the below sample for your reference.


sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/core_grid_foreignkey_filter-1904663447.zip

ForeignKey Column: https://ej2.syncfusion.com/aspnetcore/documentation/grid/columns/foreign-key-column

Still, if you face any issues, kindly share the below details to validate further.


  1. Are you using the EJ1 Grid or EJ2 Grid or any other component?
  2. Share the Grid-related code files you have used.
  3. Share the video demo of the reported problem.
  4. Which type of data-binding you have used? Share the Adaptor details.
  5. If possible, share the issue reproducible sample which will be very helpful for us.


Regards, 

Rajapandiyan S



HI Hiral November 11, 2022 01:51 PM UTC

when you are using this kind of declaration for foreign key then it will not work and ViewBag.DataSource is not working in my scenario as you showed in attached sample.


function load(args) {

var fdata = loadForeignKeyData();

this.getColumns()[7].dataSource = fdata;

}


function loadForeignKeyData(){

var data = new ej.data.DataManager({

url: '/Controller/Action',

adaptor: new ej.data.WebApiAdaptor,

offline: true

});

return data;

}


if i declare like this then there will be no suggestion 



RS Rajapandiyan Settu Syncfusion Team November 14, 2022 01:41 PM UTC

Hi Hiral,


Before proceeding with your query, kindly share the below details to validate further.


  1. Are you using the EJ1 Grid or EJ2 Grid or any other component? (highly recommended)
  2. Share the complete Grid code files you have used. (highly recommended)
  3. Share the video demo of the reported problem.
  4. If possible, share the issue reproducible sample which will be very helpful for us.


Regards, 

Rajapandiyan S


Loader.
Live Chat Icon For mobile
Up arrow icon