You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs-aspnet-core/getting-started/scaffolding.md
+34-46Lines changed: 34 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Scaffolding
3
-
page_title: Scaffolding | Progress Telerik UI for ASP.NET Core
3
+
page_title: Scaffolding | Telerik UI for ASP.NET Core
4
4
description: "Learn how to use the Kendo UI Scaffolder extensions."
5
5
slug: scaffolding_aspnetcore
6
6
position: 4
@@ -10,50 +10,42 @@ position: 4
10
10
11
11
As of the R1 2019 release, Telerik UI for ASP.NET Core provides Scaffolding templates.
12
12
13
-
They allow you to use the standard scaffolding to generate MVC-helper declarations for editors that use the Telerik UI for ASP.NET Core components instead of standard inputs.
14
-
15
-
You can use them in both MVC views and Razor Pages.
13
+
These templates allow you to apply standard scaffolding to generate MVC-helper declarations for editors which use the Telerik UI for ASP.NET Core components instead of applying standard inputs. You can use the Scaffolding extensions both in MVC views and in Razor Pages.
16
14
17
15
Depending on the type of field, the following editors will be generated:
18
16
19
-
*`String`: `input` element with Kendo styles
20
-
*`String` (multiline): `textarea` element with Kendo styles
21
-
*`Number`: `kendo-numerictextbox` tag helper
22
-
*`DateTime`: `kendo-datetimepicker` tag helper
23
-
*`Boolean`: `Html.Kendo().CheckBoxFor` helper
24
-
25
-
The scaffolding logic and tools are the same as with the ordinary .NET Core web applications. The main repository and logic for the scaffolding provided by Microsoft is [https://github.com/aspnet/Scaffolding](https://github.com/aspnet/Scaffolding). The original template files are located in its: [https://github.com/aspnet/Scaffolding/tree/master/src/VS.Web.CG.Mvc/Templates](https://github.com/aspnet/Scaffolding/tree/master/src/VS.Web.CG.Mvc/Templates) folder.
17
+
*`String`—An `input` element with Kendo UI styles.
18
+
*`String` (multiline)—A `textarea` element with Kendo UI styles.
19
+
*`Number`—A `kendo-numerictextbox` tag helper.
20
+
*`DateTime`—A `kendo-datetimepicker` tag helper.
In order to use the scaffolding provided by Microsoft you can follow these resources:
23
+
The scaffolding logic and tools are the same as in the ordinary .NET Core web applications. The main repository and logic for the scaffolding that is provided by Microsoft is located in [https://github.com/aspnet/Scaffolding](https://github.com/aspnet/Scaffolding). The original template files are located in its [https://github.com/aspnet/Scaffolding/tree/master/src/VS.Web.CG.Mvc/Templates](https://github.com/aspnet/Scaffolding/tree/master/src/VS.Web.CG.Mvc/Templates) folder.
28
24
25
+
For more information on using the scaffolding by Microsoft, refer to the following resources:
29
26
-[Add a model to an ASP.NET Core MVC app](https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/adding-model?view=aspnetcore-2.1)
30
27
-[Add a model to a Razor Pages app in ASP.NET Core](https://docs.microsoft.com/en-us/aspnet/core/tutorials/razor-pages/model?view=aspnetcore-2.1)
31
28
29
+
> **Important**
30
+
>
31
+
> The Scaffolding features allow you to generate templates based on classes. They are different from the editor templates that are used for editing by widgets such as the Grid, for example. The editor templates are located in your installation folder at `C:\Program Files (x86)\Progress\Telerik UI for ASP.NET Core <your version>\wrappers\aspnetcore\EditorTemplates`.
32
32
33
-
>tip The Scaffolding features allow you to generate templates based on classes and are different than the editor templates used by widgets like the grid for editing records. If you are looking for the editor templates, you can find them in your installation folder under `C:\Program Files (x86)\Progress\Telerik UI for ASP.NET Core <your version>\wrappers\aspnetcore\EditorTemplates`.
34
-
35
-
## Getting Started
36
-
33
+
## Prerequisites
37
34
38
-
### Requirements
35
+
Install and set up Telerik UI for ASP.NET Core in your project by either of the following ways:
*[Use the CLI](https://docs.telerik.com/aspnet-core/getting-started/getting-started-cli)
44
-
45
-
### Installation
39
+
## Installation
46
40
47
41
To install the UI for ASP.NET Core Scaffolding templates and extensions in your project:
48
42
49
-
1. Clone or Download the [https://github.com/telerik/scaffold-templates-core](https://github.com/telerik/scaffold-templates-core) repository.
50
-
51
-
1.Copy the `Templates` folder from the repo above to the **root**of your project.
43
+
1. Clone or download the [https://github.com/telerik/scaffold-templates-core](https://github.com/telerik/scaffold-templates-core) repository.
44
+
1. Copy the `Templates` folder from the `scaffold-templates-core` repository to the root of your project.
45
+
1.Exclude the `scaffold-templates-core` repository from the project to avoid its compilation when you build the application. To exclude the repository, use either of the following approaches:
52
46
53
-
1. Exclude it from the project to make sure it will not be compiled when building. There are two ways to do that:
47
+
* Add the following lines directly to the project file.
54
48
55
-
* add the following to the project file directly:
56
-
57
49
```.csproj
58
50
<ItemGroup>
59
51
<CompileRemove="Templates\**" />
@@ -62,41 +54,38 @@ To install the UI for ASP.NET Core Scaffolding templates and extensions in your
62
54
<NoneRemove="Templates\**" />
63
55
</ItemGroup>
64
56
```
65
-
66
-
* OR, use the GUI in Visual Studio:
67
-
68
-
**Figure 1. Exclude the Templates folder from compilation**
**Figure 1. Exclude the Templates folder from compilation**
74
61
75
-
The Kendo UI Scaffolding Templates pertain to cshtml generation, so you must first create the appropriate model and controller as per your applicaiton needs. You can use the standard Scaffolding, or code you already have.
If you don't have a model and controller already, below the list you can find a sample set so you can follow this example.
64
+
## Using Scaffolding Templates with Visual Studio
78
65
79
-
To add a View that will use a Kendo scaffolded template:
66
+
The Kendo UI Scaffolding Templates pertain to `cshtml` generation. That is why, first you have to create the appropriate model and controller as per your application requirements. You can either use the standard Scaffolding or the code you already have. If you do not already have a model and controller, use the sample set below the list to follow the example.
67
+
68
+
To add a View that will use a Kendo UI Scaffolding template:
80
69
81
70
1. Select **Add** > **New Scaffolded Item...** from the context menu of the desired location.
1. Set the View properties (name, template and model to match the code you already have) and click **Add**. For example, an `Edit` view for the `SampleScaffoldingData` model.
82
+
1. Set the View properties (name, template, and model to match the code you already have) and click **Add**. For example, an `Edit` view for the `SampleScaffoldingData` model.
After following the steps, you should have something similar to the following in your project. You can also use the sample class and controller to test the behavior with dummy data instead of actual models.
87
+
88
+
As a result, in your project you have an output that is similar to the following code. You can also use the sample class and controller to test the behavior with dummy data instead of actual models.
page_title: Model Binding | Kendo UI Menu HtmlHelper for ASP.NET Core
4
+
description: "Learn how to implement Model Binding with Kendo UI Menu HtmlHelper for ASP.NET Core (MVC 6 or ASP.NET Core MVC)."
5
+
slug: htmlhelpers_menu_modelbinding_aspnetcore
6
+
position: 2
7
+
---
8
+
9
+
# Model Binding
10
+
11
+
To bind a Kendo UI Menu to a hierarchical model:
12
+
13
+
1. Make sure you followed all the steps from the [introductory article on Telerik UI for ASP.NET Core]({% slug gettingstarted_aspnetmvc6_aspnetmvc %}).
14
+
15
+
1. Create a new action method and pass the **Categories** table as the model. Note that the **Categories** must be associated to the **Products** table.
16
+
17
+
```Razor
18
+
public ActionResult Index()
19
+
{
20
+
NorthwindDataContext northwind = new NorthwindDataContext();
page_title: Sitemap Binding | Kendo UI Menu HtmlHelper for ASP.NET Core
4
+
description: "Learn how to implement Sitemap Binding with Kendo UI Menu HtmlHelper for ASP.NET Core (MVC 6 or ASP.NET Core MVC)."
5
+
slug: htmlhelpers_menu_sitemapbinding_aspnetcore
6
+
position: 3
7
+
---
8
+
9
+
# Sitemap Binding
10
+
11
+
To bind a Kendo UI Menu to a sitemap:
12
+
13
+
1. Make sure you followed all the steps from the [introductory article on Telerik UI for ASP.NET Core]({% slug gettingstarted_aspnetmvc6_aspnetmvc %}).
14
+
15
+
1. Create a simple sitemap with the `sample.sitemap` file name at the root of the project.
The Menu provides a keyboard navigation functionality. When on focus, the first root item is activated.
12
+
13
+
Kendo UI Menu supports the following keyboard shortcuts and user actions:
14
+
15
+
| SHORTCUT | DESCRIPTION |
16
+
|:--- |:--- |
17
+
|`Home`| Focuses the first item |
18
+
|`End`| Focuses the last item |
19
+
| Left `Arrow` key | <ul><li>Moves the active item on the root level of horizontal Menus to the left</li> <li>Closes an item group</li></ul> |
20
+
| Right `Arrow` key | <ul><li>Moves the active item on the root level of horizontal Menus to the right</li> <li>opens an item group of a vertical Menu</li> <li>Moves the active state to the next root item of a horizontal Menu, if the previous active item has been inside an item group</li></ul> |
21
+
| Up `Arrow` key | Moves the active item of vertical Menu item groups upwards |
22
+
| Down `Arrow` key | <ul><li>Moves the active item of vertical Menu item groups downwards</li> <li>Opens an item group of a horizontal Menu</li></ul> |
23
+
|`Enter`| Selects or navigates the focused item |
24
+
|`Space`| Selects or navigates the focused item |
25
+
|`Esc`| Closes an item group |
26
+
| (`Shift`+) `Tab`| Blurs the Menu and moves the focus to the next (previous) focusable page element |
27
+
28
+
## See Also
29
+
30
+
*[JavaScript API Reference of the Menu](http://docs.telerik.com/kendo-ui/api/javascript/ui/menu)
31
+
*[Menu HtmlHelper for ASP.NET MVC](http://docs.telerik.com/aspnet-mvc/helpers/menu/overview)
32
+
*[Menu Official Demos](http://demos.telerik.com/aspnet-core/menu/index)
0 commit comments