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/getting-started-core/razor-pages.md
+16-3Lines changed: 16 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,14 +17,14 @@ The ASP.NET Razor Pages framework was introduced in ASP.NET Core 2.0 as an alter
17
17
* The `@page` directive placed at the top of the page makes it a Razor Page. The page contains both HTML and server-side logic, which you include by using Razor syntax.
18
18
19
19
* The `@model` directive specifies the type of the data that the page is expected to work with. The page uses the PageModel class itself as a view model. The required data is exposed as properties.
20
-
* The page handles requests directly, without using a controller. A naming convention is used to find the appropriate handler method to execute in the PageModel class. Handler methods are prefixed with the word `On` followed by the HTTP verb used for the request that they process: `OnGet`, `OnPost`, `OnGetAsync` and `OnPostAsync`. Following this convention, additional handlers can be included, for example `OnGetHelloWorld`.
20
+
* The page handles requests directly, without using a controller. A naming convention is used to find the proper handler method to execute in the PageModel class. Handler methods are prefixed with the word `On` followed by the HTTP verb used for the request that they process: `OnGet`, `OnPost`, `OnGetAsync` and `OnPostAsync`. Following this convention, additional handlers can be included, for example `OnGetHelloWorld`.
21
21
* Razor Pages automatically implement anti-forgery validation, which protects against cross-site request forgery (XSRF/CSRF) attacks.
22
22
23
23
You can find more information on Razor Pages in the [Microsoft Docs](https://docs.microsoft.com/en-us/aspnet/core/razor-pages/)
24
24
25
25
## Using Telerik UI for ASP.NET Core in a Razor Pages Project
26
26
27
-
There are two alternative approaches for adding Telerik UI for ASP.NET Core to a new Razor Pages project:
27
+
The two alternative approaches for adding Telerik UI for ASP.NET Core to a new Razor Pages project are:
28
28
29
29
* Use the [Telerik Extensions for Visual Studio]({% slug newprojectwizards_visualstudio_aspnetcore %}) to create a new project. The [**GRID RAZOR PAGES**]({% slug newprojectwizards_visualstudio_aspnetcore %}#available-templates) template scaffolds a Razor Pages sample, which contains a Grid with enabled CRUD operations. The benefit of this approach is that the template will add the necessary configuration and dependencies automatically. You can focus on adding and configuring the UI components you need.
30
30
* Use the default Visual Studio <ahref="https://docs.microsoft.com/en-us/aspnet/core/tutorials/razor-pages/razor-pages-start?view=aspnetcore-6.0&tabs=visual-studio"target="_blank">**ASP.NET Core Web App**</a> template, which is based on the ASP.NET Razor Pages framework. Do not use the **Web Application (Model-View-Controller)** template.
@@ -48,6 +48,19 @@ All Telerik UI for ASP.NET Core components are compatible with the ASP.NET Razor
48
48
@Html.AntiForgeryToken()
49
49
```
50
50
51
+
1. Configure the JSON serialization options of the application in the `Program.cs` file. For more information, refer to the [JSON Serialization article]({% slug jsonserialization_core %}).
1. Declare the Grid and setup the CRUD URLs in its `DataSource` configuration. Set the DataSource `Model.Id` configuration. The URL in these methods must refer to the name of the handler method in the `PageModel`:
52
65
53
66
@@ -304,7 +317,7 @@ Razor pages are automatically protected from [XSRF/CSRF](https://docs.microsoft.
304
317
305
318
## Known Limitations
306
319
307
-
Razor Pages use `Page` in their routing mechanism which interferes with `GET` requests made by the Kendo UI DataSource. As a result, only `POST` requests should be used when paging is required.
320
+
Razor Pages use `Page` in their routing mechanism which interferes with `GET` requests made by the Kendo UI DataSource. As a result, only `POST` requests must be used when paging is required.
Copy file name to clipboardExpand all lines: docs-aspnet/html-helpers/data-management/grid/context-menu.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ position: 15
8
8
9
9
# Context Menu
10
10
11
-
The {{site.product}} Grid provides a built-in ContextMenu to show the user available options, such as CRUD operations, selection and export options. A ContextMenu is shown when the user right-clicks on the Grid's table `body` or `head` elements.
11
+
The {{site.product}} Grid provides a built-in ContextMenu to show the user available options, such as CRUD operations, selection and export options. The ContextMenu opens when the user right-clicks on the Grid's table `body` or `head` elements.
12
12
13
13
By default, the Context Menu of the Telerik UI Grid for {{ site.framework }} is disabled.
14
14
@@ -118,7 +118,9 @@ The following example demonstrates how you can customize the Context Menu using
118
118
119
119
### Custom Commands
120
120
121
-
You can also register custom commands for the Context Menu. The following example demonstrates how to implement a custom command:
121
+
You can also register custom commands for the Context Menu. To add custom commands in the ContextMenu that opens when the user right-clicks on the Grid's table `body` element, use the `Body()` configuration. To add custom commands in the ContextMenu that opens when the user right-clicks on the Grid's table `header` element, use the `Head()` configuration.
122
+
123
+
The following example demonstrates how to implement a custom command that appears in the table header ContextMenu.
<context-menu-item name="myTool" text="My Custom Tool" icon="gear" command="myToolCommand"/> <!-- "myTool" is the name of the command that will be displayed as "My Custom Tool". -->
Copy file name to clipboardExpand all lines: docs-aspnet/html-helpers/layout/dialog/action-buttons.md
+42-1Lines changed: 42 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,48 @@ position: 3
10
10
11
11
The Dialog action buttons allow you to provide specific interaction to users.
12
12
13
-
Each button has a text and an action handler attached to it. Generally, each button closes the Dialog as its last action but you can cancel this from the custom action handler. The order of the values in the `Actions()` configuration method determines the order in which the action buttons are rendered in the Dialog. You can also define a button as `Primary(true)`.
13
+
Each defined button has a text and an action handler attached to it. By default, the action buttons close the Dialog, but you can prevent the Dialog from closing by setting the respective action handler to return `false`.
14
+
15
+
```HtmlHelper
16
+
@(Html.Kendo().Dialog()
17
+
.Name("dialog")
18
+
.Title("Software Update")
19
+
...
20
+
{
21
+
actions.Add().Text("Ok");
22
+
actions.Add().Text("Cancel").Action("onCancel");
23
+
})
24
+
)
25
+
26
+
<script type="text/javascript">
27
+
function onCancel(e) {
28
+
alert("Cancel action was clicked");
29
+
return false; // Returning false will prevent the closing of the Dialog.
return false; // Returning false will prevent the closing of the Dialog.
49
+
}
50
+
</script>
51
+
```
52
+
{% endif %}
53
+
54
+
The order of the values in the `Actions()` configuration method determines the order in which the action buttons are rendered in the Dialog. You can also define a button as `Primary(true)`.
14
55
15
56
The following example demonstrates how to set three action buttons in a Dialog with a `stretched` layout. The last button has an `Action()` event handler attached and is set as `Primary(true)`.
Copy file name to clipboardExpand all lines: docs-aspnet/html-helpers/layout/form/validation.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -252,7 +252,7 @@ The following example demonstrates custom validation of the `LastName` and `Reti
252
252
}
253
253
```
254
254
255
-
## Custom Validation
255
+
## DataAnnotation Attributes
256
256
257
257
The Form component supports DataAnnotation attributes and will configure the editors and the built-in validation based on the DataAnnotation attributes set for the model properties. The following table summarizes the supported DataAnnotation attributes:
Copy file name to clipboardExpand all lines: docs-aspnet/html-helpers/layout/window/use-iframe.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,10 @@ position: 6
8
8
9
9
# Using iframe
10
10
11
-
You can force the Window to display its content in an `<iframe>` element by using the `Iframe(true)` configuration method.
11
+
You can force the Window to display its content in an [`<iframe>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe) element by using the `Iframe(true)` configuration method. In this case, the Window content will be loaded into an HTML page that is embedded into the current HTML page.
12
12
13
-
> * Loading HTML fragments (partial content) inside an `iframe` is not correct. iframe pages have to include a `DOCTYPE`, `html`, `head`, and `body` tags, just like a standard web page does.
14
-
> * Avoid using iframes on iOS devices because they are not scrollable and always expand to match the content.
13
+
> * Loading HTML fragments (partial content) inside an `iframe` is not correct. Like standard web pages, `iframe` pages have to include a `DOCTYPE`, `html`, `head`, and `body` tags.
14
+
> * Avoid using an `iframe`on iOS devices because iOS devices do not support `iframe` scrolling and always expand to match the content.
15
15
16
16
The following example demonstrates how to access the `window` and `document` objects inside the `iframe`. To achieve this, the nested page has to belong to the same domain as the main page. The `iframe` is accessed through the `element` of the Window.
Copy file name to clipboardExpand all lines: docs-aspnet/installation/nuget-install.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ position: 3
11
11
12
12
This article describes how to configure your system for the Telerik NuGet source and then use it to install {{ site.product }} in your project.
13
13
14
-
[NuGet](https://www.nuget.org) is a popular .NET package manager. Telerik maintains a private NuGet feed with official {{ site.product }} releases and service packs. In the Telerik NuGet feed, you will see packages that your account has a license for; trials (active) and commerical (active and expired).
14
+
[NuGet](https://www.nuget.org) is a popular .NET package manager. Telerik maintains a private NuGet feed with official {{ site.product }} releases and service packs. In the Telerik NuGet feed, you will see packages that your account has a license for; trials (active) and commercial (active and expired).
15
15
16
16
{% if site.core %}
17
17
>tip Looking for a complete tutorial? Check out the [Getting Started guide that uses NuGet]({%slug gettingstarted_aspnetmvc6_aspnetmvc%}) to add Telerik UI to the project.
@@ -21,7 +21,9 @@ This article describes how to configure your system for the Telerik NuGet source
21
21
22
22
## Setting Up the Telerik NuGet Feed
23
23
24
-
The Telerik NuGet feed allows you instant access to various Telerik and Kendo packages that you can install in your project. Before you can use the Telerik NuGet Feed as a **Package source**, you must configure your machine by utilizing any of the following methods:
24
+
The Telerik NuGet feed allows you instant access to various Telerik and Kendo packages that you can install in your project. You can access either the latest or older versions of the suites.
25
+
26
+
Before you can use the Telerik NuGet Feed as a **Package source**, you must configure your machine by utilizing any of the following methods:
25
27
26
28
*[Use the NuGet Package Manager in Visual Studio](#setup-with-the-nuget-package-manager).
The delay in milliseconds before the formatting marks are refreshed. This feature is useful for performance optimization as the formatting marks are re-rendered any time the user presses a key. If the user is typing very fast or holding down a key, the delay will prevent the re-rendering from being executed multiple times.
4733
+
4734
+
The visual effect from this configuration is that the marks will briefly disappear while the user is typing. You can set the value to `false` to fully turn off this behavior.
4735
+
4736
+
#### Example
4737
+
4738
+
<textarea id="editor"><p>Some text with several spaces that demonstrates<br /> the re-rendering of the marks.</p></textarea>
4739
+
4740
+
<script>
4741
+
$(document).ready(function() {
4742
+
$("#editor").kendoEditor({
4743
+
tools: ["formattingMarks"],
4744
+
formattingMarksRefreshDelay: false
4745
+
});
4746
+
});
4747
+
</script>
4748
+
4730
4749
### unsafeInline `Boolean`*(default: true)*
4731
4750
4732
4751
When set to false, the decoration applied by the Formatting tool dropdown will be skipped and the values will appear as plain text options.
Copy file name to clipboardExpand all lines: docs/api/javascript/ui/grid.md
+44-5Lines changed: 44 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11244,9 +11244,9 @@ Hides the specified grid column.
11244
11244
11245
11245
#### Parameters
11246
11246
11247
-
##### column `Number|String|Object`
11247
+
##### column `Number|String|Object|Array`
11248
11248
11249
-
The index of the column, or the [field](/api/javascript/ui/grid/configuration/columns.field) to which the columns is bound, or the column object obtained from the [columns](/api/javascript/ui/grid/fields/columns) collection.
11249
+
The index of the column, or the [field](/api/javascript/ui/grid/configuration/columns.field) to which the columns is bound, or the column object obtained from the [columns](/api/javascript/ui/grid/fields/columns) collection, or array of indexes, or array of fields, or array of column objects obtained from the collection of columns, or array of mixed values.
11250
11250
11251
11251
When using multicolumn headers, using an index will hide a top-level column together with all its "child columns". In such scenarios, using field names or column objects may be more appropriate.
11252
11252
@@ -11257,7 +11257,7 @@ When using multicolumn headers, using an index will hide a top-level column toge
11257
11257
$("#grid").kendoGrid({
11258
11258
columns: [
11259
11259
{ field: "name" },
11260
-
{ field: "age" }
11260
+
{ field: "age" },
11261
11261
],
11262
11262
dataSource: [
11263
11263
{ name: "Jane Doe", age: 30 },
@@ -11309,6 +11309,25 @@ When using multicolumn headers, using an index will hide a top-level column toge
11309
11309
grid.hideColumn(grid.columns[0].columns[1]);
11310
11310
</script>
11311
11311
11312
+
#### Example - hide a column by array of mixed values
11313
+
11314
+
<div id="grid"></div>
11315
+
<script>
11316
+
$("#grid").kendoGrid({
11317
+
columns: [
11318
+
{ field: "name" },
11319
+
{ field: "age" },
11320
+
{ field: "height" }
11321
+
],
11322
+
dataSource: [
11323
+
{ name: "Jane Doe", age: 30, height: 1.75 },
11324
+
{ name: "John Doe", age: 33, height: 1.82 }
11325
+
]
11326
+
});
11327
+
var grid = $("#grid").data("kendoGrid");
11328
+
grid.hideColumn([0, 'age']);
11329
+
</script>
11330
+
11312
11331
### items
11313
11332
11314
11333
Obtains an Array of the DOM elements, which correspond to the data items from the Kendo UI DataSource [view](/api/javascript/data/datasource/methods/view) (e.g. the ones on the current page).
@@ -11979,9 +11998,9 @@ Shows the specified column.
11979
11998
11980
11999
#### Parameters
11981
12000
11982
-
##### column `Number|String|Object`
12001
+
##### column `Number|String|Object|Array`
11983
12002
11984
-
The index of the column, or the [field](/api/javascript/ui/grid/configuration/columns.field) to which the columns is bound, or the column object obtained from the [columns](/api/javascript/ui/grid/fields/columns) collection.
12003
+
The index of the column, or the [field](/api/javascript/ui/grid/configuration/columns.field) to which the columns is bound, or the column object obtained from the [columns](/api/javascript/ui/grid/fields/columns) collection, or array of indexes, or array of fields, or array of column objects obtained from the collection of columns, or array of mixed values.
11985
12004
11986
12005
When using multicolumn headers, using an index will hide a top-level column together with all its "child columns". In such scenarios, using field names or column objects may be more appropriate.
11987
12006
@@ -12044,6 +12063,26 @@ When using multicolumn headers, using an index will hide a top-level column toge
12044
12063
grid.hideColumn(grid.columns[0].columns[1]);
12045
12064
</script>
12046
12065
12066
+
#### Example - show a hidden columns by array of mixed values
0 commit comments