Server Binding

During the server data-binding mode, the data is serialized to the client and no Ajax requests are made.

To configure the ComboBox for server binding to the Northwind Products table by using Linq to SQL:

  1. Make sure you followed all the steps from the introductory article on Telerik UI for ASP.NET MVC.
  2. Create a new action method and pass the Products table as the model.

    public ActionResult Index()
    {
        NorthwindDataContext northwind = new NorthwindDataContext();
    
        return View(northwind.Products);
    }
    
  3. Make your view strongly typed.

        <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master"
            Inherits="System.Web.Mvc.ViewPage<IEnumerable<MvcApplication1.Models.Product>>" %>
    
        @model IEnumerable<MvcApplication1.Models.Product>
    
  4. Add a server bound MultiSelect.

        <%: Html.Kendo().MultiSelect()
            .Name("productMultiSelect") // The name of the MultiSelect is mandatory. It specifies the "id" attribute of the MultiSelect.
            .DataTextField("ProductName") // Specify which property of the Product to be used by the MultiSelect as a text.
            .DataValueField("ProductID") // Specify which property of the Product to be used by the MultiSelect as a value.
            .BindTo(Model)   // Pass the list of Products to the MultiSelect.
        %>
    
        @(Html.Kendo().MultiSelect()
            .Name("productMultiSelect") // The name of the MultiSelect is mandatory. It specifies the "id" attribute of the MultiSelect.
            .DataTextField("ProductName") // Specify which property of the Product to be used by the MultiSelect as a text.
            .DataValueField("ProductID") // Specify which property of the Product to be used by the MultiSelect as a value.
            .BindTo(Model)   // Pass the list of Products to the MultiSelect.
        )
    

See Also

In this article
Not finding the help you need? Improve this article