Combox Server binding issue

2 posts, 0 answers
  1. Sanjeev
    Sanjeev avatar
    1 posts
    Member since:
    Sep 2014

    Posted 26 Sep 2014 Link to this post

    My Kendo Comboxbox server binding is not working

    This is my View
                  .HtmlAttributes(new { style = "width:150px" })
                  .Text("Select State")
                  .DataSource(source =>
                      source.Read(read =>
                          read.Action("cbx_read", "Home");

    This is my Controller       

    public ActionResult cbx_read([DataSourceRequest]DataSourceRequest request)
                 using (var northwind = new Connection())
                     IQueryable<LostDayDetail> Customers = northwind.LostDayDetail;
                     DataSourceResult result = Customers.ToDataSourceResult(request, Customer => new CustomerDetail
                         Code = Customer.Code,
                         Name = Customer.Name,
                         Days = Customer.Days
                     return Json(result);

    When I click on Combobox, it calls cbx_read function and it gets all 12 rows of data from database table. but when contol comes back to view, the combobox is blank.
    Please help me

  2. Georgi Krustev
    Georgi Krustev avatar
    3724 posts

    Posted 29 Sep 2014 Link to this post

    Hello Sanjeev,

    In general, ComboBox widget supports seamless binding to an array of objects/primitive values. The DataSourceResult is not supported out of the box as it is designed to work with widgets with CRUD abilities (Grid and etc). Check this help topic for more information.

    Georgi Krustev

    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.

Back to Top