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

ServerBinding for multiple dropdowns in one View

3 Answers 34 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
GrayMeth
Top achievements
Rank 1
GrayMeth asked on 17 Sep 2014, 04:42 AM
I have a View with multiple dropdowns(15-20). Currently I implemented server binding for all of these by creating ViewData for every dropdown before loading the View. Is this the best way for implementing multiple dropdowns(server binding)?
Note: Don't want to use AJAX binding.

3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 18 Sep 2014, 01:55 PM
Hi GrayMeth,

Based on the given information, I believe that the best way to accomplish your goal is exactly usage of the BindTo method and ViewData that holds the widget data. Here you can find more information how to bind the widget on server.

If you more specific answer, I will need more information about your current implementation - Controller and View or even better a runnable test project.

Regards,
Georgi Krustev
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.

 
0
GrayMeth
Top achievements
Rank 1
answered on 25 Sep 2014, 03:25 AM
Hi Gerogi,

I am using the dropdown exactly as mentioned in the link provided by you, by using the BindTo() method of kendo dropdown.
My controller method for returning the view will be something like this.
public ActionResult XYZ()
{
      ViewData["Dropdown1"] = ServiceCall1;
      ViewData["Dropdown2"] = ServiceCall2;
      ViewData["Dropdown3"] = ServiceCall3;
      ViewData["Dropdown4"] = ServiceCall4;
      ...
      ...
      ...
      // and so on
     // finally
     return PartialView("XYZ", XYZModel);
}

This is it. Simple one. My only concern is, if this the best way to apply the functionality. Is there any other way to improve the performance?
I would try to provide you some sample project but this is it you will find in the sample also.

Regards
0
Georgi Krustev
Telerik team
answered on 26 Sep 2014, 01:07 PM
Hi,

If all dropdownlists on the page has a different data (different items), then using the ViewData to bind the widgets is absolutely applicable. Another approach is to use remote service with deferred binding (autoBind: false). Thus widgets will not fetch data until it is needed. Is there any performance issue that you want to resolve? In general, usage of particular technique depends on the desired business logic you are trying to achieve.

Best regards,
Georgi Krustev
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
DropDownList
Asked by
GrayMeth
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
GrayMeth
Top achievements
Rank 1
Share this question
or