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

Multicolumndroupdownlist

1 Answer 31 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
suman
Top achievements
Rank 1
suman asked on 02 Apr 2020, 09:15 AM

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);
        }

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 06 Apr 2020, 04:32 AM

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.
Tags
DropDownList
Asked by
suman
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or