This article demonstrates how to scaffold a Kendo UI Scheduler for ASP.NET MVC by using the Kendo UI Scaffolder Visual Studio extension.
The Kendo UI Scaffolder will not include the required
UI for ASP.NET MVCfiles to the project. To automatically achieve this, use the Telerik UI for ASP.NET MVC Visual Studio extensions. To manually achieve this, refer to this article.
Below are listed the steps for you to follow when scaffolding the Kendo UI Scheduler for ASP.NET MVC.
Create a new ASP.NET MVC application, include an Entity Framework Data Model, and add Telerik UI for ASP.NET MVC.
For information on how to do this, follow steps 1 to 5 from the article about Telerik UI for ASP.NET MVC in MVC 5 Applications.
Right-click the location where the
Scheduler Controller should be generated. Select Add > New Scaffolded Item... from the displayed menu. In this example, you are going to generate it in the Controllers folder.
Figure 1. Add a new scaffolded item
Select Kendo UI Scaffolder from the list of available scaffolders. Then choose the desired Scheduler option.
Figure 2. The Kendo UI Scaffolder
The next screen displays the
Data Context options.
Figure 3. The Controller and View names
The Model Class DropDownList contains all model types from the active project. List the products in the Scheduler. In this case, select the Product entity.
Figure 4. The Model Class list
From the Data Context Class DropDownList, select the Entity Framework Data Model class to be used. In this case, select SampleEntities. Note that the DataBase used is taken from the offline examples.
Figure 5. The Data Context class
Select the fields from your original model that match the fields from the required
ISchedulerEvent interface. The Scaffolder automatically generates a view model that inherits from the
ISchedulerEvent interface. This view model includes a constructor and a method that map the view model fields to the original model:
Figure 6. View Model fields selection
Figure 7. The View Model class
The newly created class will later be added to the
Click Scheduler Options.
Figure 8. The Scheduler options
This screen contains the Scheduler functionalities that can be configured before scaffolding:
- DataSource Type—Ajax or WebApi.
- Edit operations—Configures the operations to be included (Create, Update, Destroy, Resize, Move).
- Other options > PDF Export—Enables the PDF export functionality.
- Other options > Selectable—Enables the selection functionality.
- Scheduler Views—Opts for the desired views.
Click Events. Select the Scheduler events that you want to attach handlers to.
Figure 9. The Scheduler events
When finished with the Scheduler configuration, click Add. The
Scheduler Controllerand the corresponding
Vieware now generated.
- Overview of the Scheduler HtmlHelper
- Ajax Binding of the Scheduler HtmlHelper
- Resources of the Scheduler HtmlHelper
- Scheduler HtmlHelper How-To Examples
- Overview of the Kendo UI Scheduler Widget
- Overview of Telerik UI for ASP.NET MVC
- Fundamentals of Telerik UI for ASP.NET MVC
- Scaffolding in Telerik UI for ASP.NET MVC
- Telerik UI for ASP.NET MVC API Reference Folder
- Telerik UI for ASP.NET MVC HtmlHelpers Folder
- Tutorials on Telerik UI for ASP.NET MVC
- Telerik UI for ASP.NET MVC Troubleshooting