Evaluate Essential Studio for ASP.NET MVC free.Start building today.
Add Syncfusion ASP.NET MVC controls to your app.
Use a package manager to add Syncfusion ASP.NET MVC controls to your application now, or download Syncfusion Studio to browse samples and binaries on your desktop.
Follow these steps to integrate the ASP.NET MVC DataGrid control into an existing MVC application.
Install the required ASP.NET MVC package
Install the Syncfusion.AspNetMvc.Grid NuGet package using the Package Manager Console (PMC) in Visual Studio. Open the console from Tools → NuGet Package Manager → Package Manager Console and run the following command:
Install-Package Syncfusion.AspNetMvc.Grid -Version 35.2.12
Register your trial license key
Include your license key in Global.asax.cs before initializing any Syncfusion components.
protected void Application_Start()
{
//Register Syncfusion license key
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR_LICENSE_KEY");
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
Add Syncfusion namespace
Add the Syncfusion.EJ2 namespace reference in the Views/Web.config file under the Views folder by including it inside the <namespaces> section.
<add namespace="Syncfusion.EJ2"/>
Add theme, script reference, and script manager
Add the theme and script reference inside the <head> element of the ~/Views/Shared/_Layout.cshtml file.
<link rel="stylesheet" href="https://cdn.syncfusion.com/ej2/35.2.12/fluent2.css" /> <script src="https://cdn.syncfusion.com/ej2/35.2.12/dist/ej2.min.js"></script>
Add the ASP.NET MVC DataGrid control
Add the Syncfusion ASP.NET MVC DataGrid control to the ~/Views/Home/Index.cshtml page and configure the underlying data model or data source in ~/Controllers/HomeController.cs.
@Html.EJS().Grid("Grid").DataSource((IEnumerable<object>)ViewBag.DataSource).Columns(col =>
{
col.Field("OrderID").HeaderText("Order ID").Width("120").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
col.Field("CustomerID").HeaderText("Customer Name").Width("150").Add();
col.Field("OrderDate").HeaderText("Order Date").Width("130").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Format("yMd").Add();
col.Field("Freight").HeaderText("Freight").Width("100").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Format("C2").Add();
col.Field("ShipCountry").HeaderText("Ship Country").Width("120").Add();
}).Render()public class HomeController : Controller
{
public ActionResult Index()
{
List<Order> orders = new List<Order>
{
new Order(10248, "Ana Trujillo", new DateTime(2025,1,12), "France", 32.38),
new Order(10249, "Martin Sommer", new DateTime(2025,1,15), "Germany", 11.61),
new Order(10250, "Thomas Hardy", new DateTime(2025,2,5), "Brazil", 65.83),
new Order(10251, "Elizabeth Lincoln", new DateTime(2025,2,18), "France", 41.34),
new Order(10252, "Victoria Ashworth", new DateTime(2025,3,10), "Belgium", 51.30),
new Order(10253, "Martine Rance", new DateTime(2025,3,22), "Brazil", 58.17)
};
ViewBag.DataSource = orders;
return View();
}
public class Order
{
public Order() { }
public Order(int OrderID, string CustomerId, DateTime OrderDate, string ShipCountry, double Freight)
{
this.OrderID = OrderID;
this.CustomerID = CustomerId;
this.OrderDate = OrderDate;
this.ShipCountry = ShipCountry;
this.Freight = Freight;
}
public int? OrderID { get; set; }
public string CustomerID { get; set; }
public DateTime? OrderDate { get; set; }
public string ShipCountry { get; set; }
public double? Freight { get; set; }
}
}
Search a control. Copy its install command.
Search 245 controls across 14 platforms. Each command comes from that control’s getting-started guide, and every package is checked on NuGet, npm, or pub.dev.
Loading controls…
Evaluate faster with your coding agent.
Paste this prompt into GitHub Copilot, Claude Code, Cursor, or any agent. It sets up Syncfusion for your project from ai.syncfusion.com before it writes code.
Set up this project for Syncfusion before generating code. Fetch and follow the official instructions at https://ai.syncfusion.com then report the detected platform, installed skills, MCP status, and any required licensing action.
No key needed to install the skills. The MCP servers use the API key that comes with a free account. Agent setup guides
AI assistants
IDEs
Short, task-first walkthroughs.
Need help getting started?
Explore our resources or reach out to our support team for assistance.
Product Updates
Technical Support
AI Solutions
Syncfusion Studio for your desktop.
One small download. Browse every product, download samples and binaries, and set up your IDE and AI assistant.