This is a migrated thread and some comments may be shown as answers.

MVC Grid DropDown Editor Templates With Large DB

2 Answers 74 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Umut
Top achievements
Rank 1
Umut asked on 09 Mar 2015, 12:00 PM
I implemented inline editing for one of my Model(ClassRoom). And this model has a foreignkey coloumn which maps to the other table.(Teacher).
But i have 100.000+ Teachers in my database. What is the efficient way to load Teachers.

NOTE: (Also Teached is in the filter coloum. ) 

2 Answers, 1 is accepted

Sort by
0
Umut
Top achievements
Rank 1
answered on 09 Mar 2015, 03:17 PM
Also in the demo : http://demos.telerik.com/aspnet-mvc/grid/foreignkeycolumn


It is getting all the values of Foreign Key at first. It is not making a join query. 

public ActionResult ForeignKeyColumn()
{
PopulateCategories();
return View();
}
0
Vladimir Iliev
Telerik team
answered on 11 Mar 2015, 09:01 AM
Hi Umut,

Basically the easiest way to optimize the performance in current case is to make the target field complex type (to contain the nested object directly) and not use the ForeignKey column. This way each record would contain it's text representation and remove the need of loading all items initially. Additionally you can make the editor for this field to support search and load only the top 10 records from the search result (server filtering).  Please check the example below:

Another option is to filter the values for the ForeignKeyColumn only to the ones that are selected in the current records. 

Regards,
Vladimir Iliev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Umut
Top achievements
Rank 1
Answers by
Umut
Top achievements
Rank 1
Vladimir Iliev
Telerik team
Share this question
or