How to a have foreignkeyfield/value mechannism without having to load the whole dataSource.

Hi,

I have a grid where I would like to have a foreignkeyfield/foreignkeyvalue mechanism, meaning I want to hold "id" values and display "name" values.
I have used this syntax for my column :

col.Field("SomethingId")..ForeignKeyField("Id").ForeignKeyValue("Name").DataSource(myData).Add();

and it works as intended, the problem is, that "myData" (the datasource) can be really big, and I wouldn't want to load it all, is there a way where to keep this foreignkeyfield/value mechanism without having to load the whole datasource ?

I'll gladly give you more informations if needed, or if I wasn't clear enough.

Thank you.

Remy

1 Reply 1 reply marked as answer

TS Thiyagu Subramani Syncfusion Team May 20, 2021 01:08 AM UTC

Hi Remy, 
  
Thanks for contacting Syncfusion support. 
  
Based on your shared information we suspect that you want to keep foreignkeyfield/value without having to load the whole DataSource. By default, in EJ2 Grid we have options to perform On-Demand Grid actions which help you to load Grid records based on demands. So, we suggest you use URL Adaptor which requests the data to server only for current page records and by default 12 records, which can be adjusted as per requirement.  
  
To achieve your requirement, we suggest you use URL Adaptor for both Grid and foreign key column. 
  
We have explained URL adaptors and in demand actions in below documentation link. Please refer it.  
  
  
Please get back to us, if you need any further assistance. 
  
Regards, 
Thiyagu S 


Marked as answer
Loader.
Up arrow icon