Scaffolding for Telerik UI for ASP.NET MVC
As of the Q1 2015 release, Telerik UI for ASP.NET MVC provides Scaffolding templates.
ASP.NET Scaffolding is a code generation framework for ASP.NET applications. Telerik UI for ASP.NET MVC makes use of this framework and offers Scaffolding templates that aim to accelerate and ease the process of building an application for both Razor Pages and MVC. These templates allow you to generate helper declarations together with the related Controller action methods.
Some of the components that provide Scaffolding templates are the Grid, Scheduler, Chart, and TreeView:
- Scaffolding of the Grid HtmlHelper
- Scaffolding of the Chart HtmlHelper
- Scaffolding of the Scheduler HtmlHelper
- Scaffolding of the TreeView HtmlHelper
Install Telerik UI for ASP.NET MVC and set up your project by using either of the following approaches:
- Starting a project from a Template in Visual Studio
- Adding Telerik UI through local files in Visual Studio
To use the scaffolding template, your development environment must meet the following requirements:
- Visual Studio 2015 or later
- ASP.NET MVC 5
- Entity Framework Data Model
The Scaffolder templates do not work in Visual Studio 2019 version 16.9.0+. A breaking change has been introduced in these Visual Studio 2019 versions, which affects the third party scaffolders. The issue has been reported to Microsoft, see Developer Community topic.
The Telerik UI for ASP.NET MVC installer automatically install the required Visual Studio extension.
You can also manually install it by navigating to the
wrappers\aspnetmvc\Scaffolding folder of the distribution package and open the included
vsix file. It will automatically detect compatible Visual Studio versions.
Setting Up the Project
To initially set up Scaffolder Visual Studio extension:
From the New Scaffolded Item... menu which contains different items depending on the currently installed Scaffolders, access the Scaffolder extension.
From the next menu, select Kendo UI Scaffolder. As a result, the Scaffolding configuration panel opens.
Select the Grid, Chart, or Scheduler control. The Controller and the corresponding view will be generated in the currently selected location.