This question is locked. New answers and comments are not allowed.
This is from http://www.telerik.com/help/aspnet-mvc/telerik-ui-components-combobox-data-binding-client-side-binding.html.
It works well on my project for combobox.
My question is how I can assign "selectedvalue" when there is a value from database on the combobox.
Right now the combobox show values from the first what so ever.
It works well on my project for combobox.
My question is how I can assign "selectedvalue" when there is a value from database on the combobox.
Right now the combobox show values from the first what so ever.
Controller
public class HomeController : Controller { //Used for the Ajax binding public ActionResult _AjaxBinding(string text) { var northwind = new NorthwindDataContext(); // Return all products as JSON - {Text:'ProductName', Value:'ProductID'} return new JsonResult { Data = new SelectList(northwind.Products.ToList(), "ProductID", "ProductName") }; } // Renders the view initially. public ActionResult Index() { return View() } }