Edit this page

Scaffolding

This article demonstrates how to scaffold a Kendo UI Scheduler for ASP.NET MVC by using the Kendo UI Scaffolder Visual Studio extension.

Important

The Kendo UI Scaffolder will not include the required UI for ASP.NET MVC files 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.

Configuration

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

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.

Generate the Scheduler Controller

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

New Scaffolded Item

Select the Scaffolder

Select Kendo UI Scaffolder from the list of available scaffolders. Then choose the desired Scheduler option.

Figure 2. The Kendo UI Scaffolder

Kendo UI Scaffolder

Choose Model and Data Options

The next screen displays the Model and Data Context options.

  1. Enter the Controller and View names.

    Figure 3. The Controller and View names

    Scheduler options

  2. 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

    Model Class

  3. 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

    Data Context Class

Set the View Model

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

View Model Fields Selection

Figure 7. The View Model class

The newly created class will later be added to the ~/Models folder.

View Model Class

Pick the Scheduler Options

  1. Click Scheduler Options.

    Figure 8. The Scheduler options

    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.
  2. Click Events. Select the Scheduler events that you want to attach handlers to.

    Figure 9. The Scheduler events

    Scheduler options

  3. When finished with the Scheduler configuration, click Add. The Scheduler Controller and the corresponding View are now generated.

See Also