Skip to content

Commit 642306f

Browse files
committed
Sync with Kendo UI Professional
1 parent bed7e33 commit 642306f

13 files changed

+147
-102
lines changed

docs-aspnet/_config-mvc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ knowledge-base/validator-basic-form-validation.md,
7070
knowledge-base/vs-online-continuous-integration-login-problem.md,
7171
knowledge-base/grid-toggle-editable-mode.md,
7272
knowledge-base/grid-export-parent-and-all-detail-grids-to-excel.md,
73-
html-helpers/data-management/grid/binding/local.md,
73+
html-helpers/data-management/grid/binding/razor-page.md,
7474
knowledge-base/vs-2015-support.md,
7575
knowledge-base/trial-to-commercial-license-troubleshooting.md,
7676
knowledge-base/vs-code-extension-issues.md,

docs-aspnet/getting-started-mvc/first-steps.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ Other popular approaches for starting with Telerik UI for ASP.NET MVC include:
2929

3030
* Telerik UI for ASP.NET MVC requires the <a href="https://dotnet.microsoft.com/download/dotnet-framework" target="_blank">.NET Framework</a>.
3131

32-
* [Visual Studio](https://www.visualstudio.com/downloads/) 2012 or later.
33-
34-
For Visual Studio 2017 or later, you must install the **ASP.NET & web development** workload. See Microsoft's <a href="/docs.microsoft.com/en-us/visualstudio/install/install-visual-studio?view=vs-2019#step-4---choose-workloads" target="_blank">Install Visual Studio workloads</a> documentation for guidance.
35-
32+
* [Visual Studio](https://www.visualstudio.com/downloads/) 2019, 2022, or later.
3633
* [Telerik account](https://www.telerik.com/account).
3734

3835
## Downloading and Installing
@@ -69,13 +66,19 @@ After the Visual Studio Extensions are installed, create a Telerik ASP.NET MVC a
6966

7067
![{{ site.product_short }} Create a new Telerik application](../getting-started-mvc/images/create-new-project-mvc.png)
7168

72-
1. Select the **GRID AND MENU** template.
69+
1. Configure the project. Click **Create**.
70+
71+
![{{ site.product_short }} Configure the project](../getting-started-mvc/images/configure-new-mvc-project.png)
72+
73+
1. Select the **GRID AND MENU** template. Click **Next**.
7374

7475
For more information on the additional predefined Telerik template options, refer to the [Creating New Projects]({% slug newprojectwizards_visualstudio_aspnetcore %}) article.
7576

7677
![{{ site.product_short }} New Project Wizard templates](../getting-started-mvc/images/create-new-project-templates-mvc.png)
7778

78-
1. Select the **Default-v2** visual theme for your Telerik ASP.NET MVC Application, and click **Finish** to complete the creation of the application.
79+
1. Choose a [Theme](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview#using-the-build-process-of-the-themes). Click **Finish**.
80+
81+
![{{ site.product_short }} Choose a Theme](../getting-started-mvc/images/select-theme-project-template-mvc.png)
7982

8083
The newly created application already has a reference to the required `Kendo.Mvc.dll` assembly. The wizard also references the client-side resources (the Kendo UI script and theme-related CSS files) in the `_Layout.cshtml`.
8184

21.8 KB
Loading
43.8 KB
Loading
18.3 KB
Loading
52.9 KB
Loading
156 KB
Loading

docs-aspnet/html-helpers/data-management/grid/binding/local.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@ To configure the Grid for {{ site.framework }} to do local binding:
3535

3636
1. Open the `HomeController.cs` and return an `IEnumerable` of the model type with the View. This is the `View()` which holds the Grid definition.
3737

38+
{% if site.core %}
39+
```HomeController.cs
3840
public IActionResult Index()
3941
{
4042
// Returns a collection of OrderViewModels.
4143
var model = orderService.Read();
4244

43-
/* For a quick test, you can mock the data, and copy and paste this snippet.
45+
/* For a quick test, you can mock the data, and copy and paste this snippet.
4446
var model = Enumerable.Range(1, 20).Select(i => new OrderViewModel
4547
{
4648
OrderID = i,
@@ -50,6 +52,26 @@ To configure the Grid for {{ site.framework }} to do local binding:
5052

5153
return View(model);
5254
}
55+
```
56+
{% else %}
57+
```HomeController.cs
58+
public ActionResult Index()
59+
{
60+
// Returns a collection of OrderViewModels.
61+
var model = orderService.Read();
62+
63+
/* For a quick test, you can mock the data, and copy and paste this snippet.
64+
var model = Enumerable.Range(1, 20).Select(i => new OrderViewModel
65+
{
66+
OrderID = i,
67+
ShipCountry = i % 2 == 0 ? "ShipCountry 1" : "ShipCountry 2"
68+
});
69+
*/
70+
71+
return View(model);
72+
}
73+
```
74+
{% endif %}
5375

5476
1. In the `Index.cshtml` view, configure the Grid to accept the model in its constructor and set `ServerOperations(false)`.
5577

docs-aspnet/html-helpers/datasource/events.md

Lines changed: 58 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -8,65 +8,83 @@ position: 5
88

99
# Events
1010

11-
You can subscribe to [all DataSource events](/api/kendo.mvc.ui.fluent/datasourceeventbuilder) and then use them to further customize the behavior of the DataSource.
11+
You can subscribe to the [available DataSource events](/api/kendo.mvc.ui.fluent/datasourceeventbuilder) and further customize the behavior of the DataSource.
1212

13-
The example below demonstrates how to use the [`Error`](/api/kendo.mvc.ui.fluent/datasourceeventbuilder#errorsystemstring), [`RequestStart`](/api/kendo.mvc.ui.fluent/datasourceeventbuilder#requeststartsystemstring) and [`RequestEnd`](/api/kendo.mvc.ui.fluent/datasourceeventbuilder#requestendsystemstring) events.
13+
## Handling by Handler Name
1414

15-
```HtmlHelper
16-
@using Kendo.Mvc.UI
15+
The following example demonstrates how to subscribe to events by a handler name.
1716

18-
@(Html.Kendo().DataSource<Kendo.Mvc.Examples.Models.ProductViewModel>()
17+
```HtmlHelper
18+
@(Html.Kendo().DataSource<ProductViewModel>()
1919
.Name("dataSource1")
2020
.Ajax(dataSource => dataSource
21-
.Read(read => read.Action("Products_Read", "DataSource"))
22-
.ServerOperation(true)
23-
.PageSize(12)
24-
.Events(e=>e.Error("error_handler").RequestStart("onRequestStart").Request("onRequestEnd"))
21+
.Events(ev => ev.RequestStart("onRequestStart"))
22+
.Read(read => read.Action("Products_Read", "DataSource"))
23+
... // Additional configuration
2524
)
2625
)
26+
27+
<script>
28+
function onRequestStart(e){
29+
// Handle the RequestStart event that triggers the DataSource makes a request to the remote service.
30+
}
31+
</script>
2732
```
33+
2834
{% if site.core %}
2935
```TagHelper
30-
<kendo-datasource name="dataSource1" type="DataSourceTagHelperType.Ajax" server-operation="true" page-size="12"
31-
on-error="error_handler"
32-
on-request-end="onRequestEnd"
33-
on-request-start="onRequestStart">
36+
<kendo-datasource name="dataSource1" type="DataSourceTagHelperType.Ajax" on-request-start="onRequestStart">
3437
<transport>
3538
<read url="@Url.Action("Products_Read", "DataSource")" />
3639
</transport>
40+
<!-- Additional configuration -->
3741
</kendo-datasource>
42+
43+
<script>
44+
function onRequestStart(e){
45+
// Handle the RequestStart event that triggers when the DataSource makes a request to the remote service.
46+
}
47+
</script>
3848
```
3949
{% endif %}
40-
```JavaScript
41-
function error_handler(e){
42-
if (e.errors) {
43-
var message = "Errors:\n";
44-
$.each(e.errors, function (key, value) {
45-
if ('errors' in value) {
46-
$.each(value.errors, function () {
47-
message += this + "\n";
48-
});
50+
51+
## Handling by Template Delegate
52+
53+
The following example demonstrates how to subscribe to events by a template delegate.
54+
55+
```HtmlHelper
56+
@(Html.Kendo().DataSource<ProductViewModel>()
57+
.Name("dataSource1")
58+
.Ajax(dataSource => dataSource
59+
.Read(read => read.Action("Products_Read", "DataSource"))
60+
.Events(e => e.RequestStart(@<text>
61+
function() {
62+
// Handle the RequestStart event inline.
4963
}
50-
});
51-
alert(message);
52-
}
53-
}
54-
function onRequestStart(e){
55-
if(e.type=="create"){
56-
//apply logic
57-
}
58-
}
59-
function onRequestEnd(e){
60-
//access the raw remote service response
61-
console.log(e.response);
62-
}
64+
</text>)
65+
)
66+
... // Additional configuration
67+
)
68+
)
6369
```
6470

65-
## Next Steps
66-
67-
* [API for Configuring the DataSource Events](/api/kendo.mvc.ui.fluent/datasourceeventbuilder)
68-
* [Using the DataSource Events (Demo)](https://demos.telerik.com/{{ site.platform }}/datasource/events)
71+
{% if site.core %}
72+
```TagHelper
73+
<kendo-datasource name="dataSource1" type="DataSourceTagHelperType.Ajax" on-request-start="function() {
74+
// Handle the RequestStart event inline.
75+
}">
76+
<transport>
77+
<read url="@Url.Action("Products_Read", "DataSource")" />
78+
</transport>
79+
<!-- Additional configuration -->
80+
</kendo-datasource>
81+
```
82+
{% endif %}
6983

7084
## See Also
7185

72-
* [Using the API of the DataSource for {{ site.framework }} (Demo)](https://demos.telerik.com/{{ site.platform }}/datasource/api)
86+
* [DataSource Server-Side API for {{ site.framework}}](/api/datasource)
87+
{% if site.core %}
88+
* [DataSource Server-Side TagHelper API for ASP.NET Core](https://docs.telerik.com/{{ site.platform }}/api/taghelpers/datasource)
89+
{% endif %}
90+
* [DataSource Client-Side API](https://docs.telerik.com/kendo-ui/api/javascript/data/datasource)

docs-aspnet/knowledge-base/grid-export-multiple-grids-to-excel.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ The example below relies on the following key steps:
8888
<script>
8989
// Use Promises to sync the exports.
9090
var promises = [
91-
$.Deferred(),
92-
$.Deferred()
91+
$.Deferred(),
92+
$.Deferred()
9393
];
9494

9595
function exportDataClick(e) { //"Export to Excel" button "click" event handler.
@@ -102,19 +102,26 @@ The example below relies on the following key steps:
102102
.then(function (productsWorkbook, ordersWorkbook) {
103103
// Create a new workbook using the sheets of the "products" and "orders" workbooks.
104104
var sheets = [
105-
productsWorkbook.sheets[0],
106-
ordersWorkbook.sheets[0]
105+
productsWorkbook.sheets[0],
106+
ordersWorkbook.sheets[0]
107107
];
108108
sheets[0].title = "Products";
109109
sheets[1].title = "Orders";
110110
var workbook = new kendo.ooxml.Workbook({
111111
sheets: sheets
112112
});
113113
// Save the new workbook.
114-
kendo.saveAs({
115-
dataURI: workbook.toDataURL(),
116-
fileName: "ProductsAndOrders.xlsx"
117-
})
114+
workbook.toDataURLAsync().then(function(dataURL) {
115+
kendo.saveAs({
116+
dataURI: dataURL,
117+
fileName: "ProductsAndOrders.xlsx"
118+
});
119+
});
120+
121+
promises = [
122+
$.Deferred(),
123+
$.Deferred()
124+
];
118125
});
119126
}
120127
function products_excelExport(e) { //"ExcelExport" event handler of "products" Grid.

0 commit comments

Comments
 (0)