In this article, we will discuss how to working with kendo multi column Combobox in MVC with SQL server we will implementing this example

Steps For Implementing multi column Combobox
- Create a new Asp.Net MVC Project
- Create a new table in SQL Server
- Add entity Framework
- implementing the control and view
Create a new Asp.net MVC Project
Go to the visual studio ⭢ file ⭢ new ⭢ project ⭢ select Asp.net web Application and enter a name like multicolumnCombobox ⭢ ok

Create a new table in SQL server
Go to SQL server create a table name like product following given query
CREATE TABLE [dbo].[Product](
[Id] [int] IDENTITY(1,1) NOT NULL,
[ProductName] [nvarchar](50) NOT NULL,
[SupplierId] [int] NOT NULL,
[UnitPrice] [decimal](12, 2) NULL,
[IsDiscontinued] [bit] NOT NULL
) ON [PRIMARY]
GO
insert some dummy data in the product table
insert into Product (ProductName,SupplierId,UnitPrice,IsDiscontinued)values('Uncle Bobs Organic Dried Pears',3,30.00,0)
insert into Product (ProductName,SupplierId,UnitPrice,IsDiscontinued)values('Northwoods Cranberry Sauce',3,40.00,0)
insert into Product (ProductName,SupplierId,UnitPrice,IsDiscontinued)values('Mishi Kobe Niku',4,97.00,1)
insert into Product (ProductName,SupplierId,UnitPrice,IsDiscontinued)values('Ikura',4,31.00,0)
Add entity Framework
Go to visual studio Add Ado.Net entity data Model

Implementing the control and view
In Homecontroller by using ProductDBEntities context we will return the product result as JSON format to view
public class HomeController : Controller
{
private ProductDBEntities objproductDBEntities;
public HomeController()
{
objproductDBEntities = new ProductDBEntities();
}
// GET: Home
public ActionResult Index()
{
return View();
}
public JsonResult GetAllProducts()
{
return Json(objproductDBEntities.Products.ToList(), JsonRequestBehavior.AllowGet);
}
}
products JSON results we will bind the kendo grid data source by using jquery, we want to require some external CDN’s for implementing kendo multi column Combobox in MVC
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.3.1017/styles/kendo.common-material.min.css" />
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.3.1017/styles/kendo.material.min.css" />
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.3.1017/styles/kendo.material.mobile.min.css" />
<script src="https://kendo.cdn.telerik.com/2018.3.1017/js/jquery.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2018.3.1017/js/kendo.all.min.js"></script>
View Implementing
@{
ViewBag.Title = "Index";
}
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.3.1017/styles/kendo.common-material.min.css" />
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.3.1017/styles/kendo.material.min.css" />
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.3.1017/styles/kendo.material.mobile.min.css" />
<script src="https://kendo.cdn.telerik.com/2018.3.1017/js/jquery.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2018.3.1017/js/kendo.all.min.js"></script>
<br />
<script type="text/javascript">
$(document).ready(function () {
dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "/Home/GetAllProducts",
dataType: "json"
}
}
});
$("#divproducts").change(function () {
alert($("#divproducts").val());
});
$("#divproducts").kendoMultiColumnComboBox({
dataTextField: "ProductName",
dataValueField: "Id",
height: 450,
columns: [
{
field: "ProductName",
title: "ProductName",
width: 150
},
{
field: "SupplierId",
title: "SupplierId",
width: 150
},
{
field: "UnitPrice",
title: "UnitPrice",
width: 150
}
],
filter: "contains",
filterFields: ["ProductName", "SupplierId", "UnitPrice"],
dataSource: dataSource
});
});
</script>
<h2>MultiColumn Dropdown List</h2>
<div class="col-md-3">
<div id="divproducts" style="width: 100%">
</div>
</div>
Run the Application Thanks..
- how to create ASP.NET Core 3 Web API Project - January 21, 2022
- JWT Authentication using OAUTH - January 10, 2022
- Ado.net database Transactions - January 9, 2022
As I web site possessor I believe the content matter here is rattling excellent , appreciate it for your efforts. You should keep it up forever! Good Luck.
I do not even understand how I ended up here, however I assumed this publish used to be great. I don’t understand who you might be but definitely you’re going to a well-known blogger if you are not already 😉 Cheers!
Usually posts some extremely interesting stuff like this.
Bookmarked!, I really like your web site!
Here is a superb Blog You might Obtain Fascinating that we encourage you to visit.
First time visiting your website, I love your blog!
Bookmarked!, I like your blog!
Bookmarked!, I enjoy your web site!
One of our guests lately advised the following website.
First time visiting your website, I love it!
tҺe website іѕ really good, I love your website!
Usually posts some quite fascinating stuff like this
Here are a number of the sites we recommend for our visitors.