Multicolumndroupdownlist

2 posts, 0 answers
  1. suman
    suman avatar
    1 posts
    Member since:
    Mar 2020

    Posted 02 Apr Link to this post

    i did not bind Multicolumndroupdownlist

     

    view

                            @(Html.Kendo().MultiColumnComboBox()
                  .Name("customers")
                  .Placeholder("Select customer")
                  .DataTextField("CustName")
                  .DataValueField("CustomerID")
                  .Columns(columns =>
                  {
                      columns.Add().Field("CustName").Title("Name");
                      columns.Add().Field("CustomerID").Title("ID");
                  })
                  .HtmlAttributes(new { style = "width:100%;" })
                  .Filter("contains")
                  .AutoBind(false)
                  .MinLength(2)
                  .DataSource(source =>
                  {
                      source.Read(read =>
                      {
                          read.Action("GetCustomers", "OrderManagement");
                      })
                      .ServerFiltering(true);
                  })
                )

     

     

     

     

     

    Controller

     

     public ActionResult GetCustomers(string text)
            {
                ApplicationDbContext db = new ApplicationDbContext();
                var customers = db.Customers.Select(customer => new Customer
                {
                    CustomerId = customer.CustomerId,
                    CustName = customer.CustName,
                    PhoneNo = customer.PhoneNo
                });

                if (!string.IsNullOrEmpty(text))
                {
                    customers = db.Customers.Where(p => p.CustName.Contains(text));
                }
               // return Json(GetOrders().ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
                return Json(customers, JsonRequestBehavior.AllowGet);
            }

     

     

     

     

  2. Dimitar
    Admin
    Dimitar avatar
    801 posts

    Posted 05 Apr Link to this post

    Hello Suman,

    I have reviewed the code snippet provided and the configuration of the MultiColumnComboBox looks correct. That being said, could you elaborate in more details on what the exact issue is so that I am able to continue my investigation?

    You could also refer to the following MultiColumnComboBox Demo for ASP.NET MVC where a similar scenario with server filtering is also demonstrated:

    I am looking forward to hearing from you.

    Regards,
    Dimitar
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top