Skip to content

Commit 7961206

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent 6c65309 commit 7961206

File tree

6 files changed

+153
-61
lines changed

6 files changed

+153
-61
lines changed

docs-aspnet/_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,9 +544,9 @@ navigation:
544544
"*/orgchart":
545545
isNew: true
546546
title: "OrgChart"
547-
"*progressbar":
547+
"html-helpers/interactivity/progressbar":
548548
title: "ProgressBar"
549-
"*circularprogressbar":
549+
"html-helpers/interactivity/circularprogressbar":
550550
title: "CircularProgressBar"
551551
"*qrcode":
552552
title: "QRCode"

docs-aspnet/html-helpers/data-management/grid/editing/overview.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,65 @@ The Grid provides the following edit modes:
1818
* [Custom editors and validation]({% slug customediting_grid_aspnetcore %})
1919
* [WebAPI editing]({% slug webapi_editing_grid_aspnetmvc %})
2020

21+
22+
23+
## Getting Started
24+
25+
To enable editing:
26+
27+
1. Set the `editable` option:
28+
```
29+
@(Html.Kendo().Grid<ProductViewModel>()
30+
.Name("Grid")
31+
...
32+
.Editable(e => e.Enabled(true))
33+
```
34+
35+
The default edit mode is [Inline](http://127.0.0.1:4000/{{ site.platform }}/html-helpers/data-management/grid/editing/inline). To use a different edit mode, specify it:
36+
37+
.Editable(e => e.Mode(GridEditMode.PopUp))
38+
39+
>For more information, refer to the [API options on the possible configurations](https://docs.telerik.com/{{ site.platform }}/api/Kendo.Mvc.UI.Fluent/GridBuilder#editablesystemactionkendomvcuifluentgrideditingsettingsbuildert).
40+
41+
2. Declare the endpoint to which the updated records will be sent:
42+
```
43+
.DataSource(dataSource => dataSource
44+
.Ajax()
45+
.PageSize(20)
46+
...
47+
.Update("Editing_Update", "Grid")
48+
```
49+
3. Specify the `Id` of the `Model` within the `DataSource` declaration:
50+
51+
```
52+
.Model(model => model.Id(p => p.ProductID))
53+
```
54+
55+
>The `Model` method configures the model of the data source. For more information, refer to the article about the [`Model` definition](https://docs.telerik.com/{{ site.platform }}/html-helpers/datasource/model).
56+
57+
4. On the server, the expected parameters must be the DataSource request and the same model as the edited one:
58+
59+
```
60+
[AcceptVerbs("Post")]
61+
public ActionResult EditingInline_Update([DataSourceRequest] DataSourceRequest request, ProductViewModel product)
62+
{
63+
if (product != null && ModelState.IsValid)
64+
{
65+
productService.Update(product);
66+
}
67+
68+
return Json(new[] { product }.ToDataSourceResult(request, ModelState));
69+
}
70+
```
71+
72+
>For runnable examples, refer to [the demos on implementing the editing approaches in the Grid](https://demos.telerik.com/{{ site.platform }}/grid/editing-inline).
73+
2174
## See Also
2275
2376
* [Incell Editing by the Grid HtmlHelper for {{ site.framework }} (Demo)](https://demos.telerik.com/{{ site.platform }}/grid/editing)
2477
* [Inline Editing by the Grid HtmlHelper for {{ site.framework }} (Demo)](https://demos.telerik.com/{{ site.platform }}/grid/editing-inline)
2578
* [Popup Editing by the Grid HtmlHelper for {{ site.framework }} (Demo)](https://demos.telerik.com/{{ site.platform }}/grid/editing-popup)
2679
* [Custom Editor by the Grid HtmlHelper for {{ site.framework }} (Demo)](https://demos.telerik.com/{{ site.platform }}/grid/editing-custom)
2780
* [Custom Validation Editing by the Grid HtmlHelper for {{ site.framework }} (Demo)](https://demos.telerik.com/{{ site.platform }}/grid/editing-custom-validation)
81+
* [Find Out More in the Knowledge Base](https://docs.telerik.com/{{ site.platform }}/knowledge-base)
2882
* [Server-Side API](/api/grid)

docs-aspnet/html-helpers/data-management/grid/export/excel-export.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ For a runnable example, refer to the [demo on Excel export by the Grid](https://
1717

1818
To enable the Excel export option of the Grid:
1919

20-
1. Include the corresponding toolbar command and set the export settings.
21-
* [Toolbar configuration](/api/Kendo.Mvc.UI.Fluent/GridToolBarCommandFactory#excel)
22-
* [Excel export configuration](/api/Kendo.Mvc.UI.Fluent/GridExcel{% if site.core %}Settings{% endif %}Builder)
20+
1. Include the [toolbar configuration](/api/Kendo.Mvc.UI.Fluent/GridToolBarCommandFactory#excel).
21+
1. Set the [export options](/api/Kendo.Mvc.UI.Fluent/GridExcel{% if site.core %}Settings{% endif %}Builder).
2322
1. To take full advantage of the Excel export feature, download the JSZip library and include the file before the Kendo UI JavaScript files in the `Layout.cshtml`. For more information, refer to the article with the [requirements]({% if site.core %}{% slug exportsupport_core %}{% else %}{% slug exportsupport_aspnetmvc %}{% endif %}#jszip-library).
2423

2524
```HtmlHelper
2625
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
2726
<script src="http://cdnjs.cloudflare.com/ajax/libs/jszip/2.4.0/jszip.js"></script>
2827
<script src="https://kendo.cdn.telerik.com/{{ site.mvcCoreVersion }}/js/kendo.all.min.js"></script>
28+
2929
@(Html.Kendo().Grid<ProductViewModel>()
3030
.Name("grid")
3131
.ToolBar(tools => tools.Excel())
@@ -42,6 +42,7 @@ To enable the Excel export option of the Grid:
4242
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
4343
<script src="http://cdnjs.cloudflare.com/ajax/libs/jszip/2.4.0/jszip.js"></script>
4444
<script src="https://kendo.cdn.telerik.com/{{ site.mvcCoreVersion }}/js/kendo.all.min.js"></script>
45+
4546
<kendo-grid name="grid">
4647
<toolbar>
4748
<toolbar-button name="excel"></toolbar-button>
@@ -59,7 +60,7 @@ To enable the Excel export option of the Grid:
5960
6061
To initiate the Excel export, press the **Toolbar** button or use the [Grid client-side API](https://docs.telerik.com/kendo-ui/api/javascript/ui/grid) and call the [`saveAsExcel`](https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/methods/saveasexcel) method.
6162
62-
> Browser versions, such as Internet Explorer 9 and earlier and Safari, require the implementation of a server proxy.
63+
> Browser versions, such as Internet Explorer 9 and earlier, and Safari, require the implementation of a server proxy.
6364
6465
[HttpPost]
6566
public ActionResult Pdf_Export_Save(string contentType, string base64, string fileName)
@@ -71,13 +72,13 @@ To initiate the Excel export, press the **Toolbar** button or use the [Grid clie
7172
7273
## Outputting the Result
7374
74-
Through its default configuration, the Telerik UI Grid for {{ site.framework }} exports the current page of the data with sorting, filtering, grouping, and aggregates applied. To export all pages, refer to [this section](#exporting-all-data).
75+
Through its default configuration, the Telerik UI Grid for {{ site.framework }} exports the current page of the data with sorting, filtering, grouping, and aggregates applied. To export all pages, refer to the section on [exporting all data](#exporting-all-data).
7576
76-
The Grid uses the current column order, visibility, and dimensions to generate the Excel file. It does not export the current CSS theme in the Excel file. For more information on changing the visual appearance of the Excel document, refer to [this section](#customizing-excel-documents).
77+
The Grid uses the current column order, visibility, and dimensions to generate the Excel file. It does not export the current CSS theme in the Excel file. For more information on changing the visual appearance of the Excel document, refer to the section about [customizing the Excel documents](#customizing-excel-documents).
7778
7879
> * The Grid exports only data-bound columns. Template and command columns are ignored.
79-
> * The `Format` option is not used during export. For more information on this, refer to [this section](#defining-the-column-format).
80-
> * The `ClientTemplate` option is not used during export. For more information on this, refer to [this section](#setting-the-column-templates).
80+
> * The `Format` option is not used during export. For more information, refer to the section about [defining the column format](#defining-the-column-format).
81+
> * The `ClientTemplate` option is not used during export. For more information, refer to the section on [setting the column templates](#setting-the-column-templates).
8182
8283
## Exporting All Data
8384
@@ -116,7 +117,7 @@ By default, the Telerik UI Grid for {{ site.framework }} exports only the curren
116117

117118
## Customizing Excel Documents
118119

119-
The [`ExcelExport()`](/api/Kendo.Mvc.UI.Fluent/GridEventBuilder#excelexportsystemstring) event allows the customization of the generated Excel document. The `workbook` event argument exposes the generated Excel workbook configuration. For more information on how the Excel documents work, refer to the article on [Excel export in Kendo UI for jQuery](https://docs.telerik.com/kendo-ui/framework/excel/introduction).
120+
The [`ExcelExport()`](/api/Kendo.Mvc.UI.Fluent/GridEventBuilder#excelexportsystemstring) event allows the customization of the generated Excel document. The `workbook` event argument exposes the generated Excel workbook configuration. For more information on how the Excel documents work, refer to the article on [Excel export in Kendo UI for jQuery]({% slug introduction_excelexport_kendoui %}).
120121

121122
1. Attach an excel export handler.
122123

@@ -129,7 +130,7 @@ The [`ExcelExport()`](/api/Kendo.Mvc.UI.Fluent/GridEventBuilder#excelexportsyste
129130
)
130131
```
131132
132-
1. In the handler, manipulate the generated workbook. The example alternates the [background color of the rows cells](https://docs.telerik.com/kendo-ui/api/javascript/ooxml/workbook/configuration/sheets.rows.cells.background).
133+
1. In the handler, manipulate the generated workbook. The example alternates the [background color of the row cells](https://docs.telerik.com/kendo-ui/api/javascript/ooxml/workbook/configuration/sheets.rows.cells.background).
133134
134135
<script>
135136
function excelExport(e) {
@@ -225,11 +226,12 @@ The [page on creating a custom number format](https://support.office.com/en-us/a
225226
</script>
226227
227228
{% if site.mvc %}
228-
## Use the Detail Template
229+
230+
## Using the Detail Template
229231
230232
The Kendo UI Grid does not export its `DetailTemplate` for the same reason it does not export the column templates. If the detail template contains another Grid, follow [this runnable how-to example]({% slug howto_detailgridexcelexport_aspnetmvcgrid %}).
231233
232-
## Export Multiple Grids
234+
## Exporting Multiple Grids
233235
234236
For more information on how to export multiple Grids to a separate Excel sheet in a single Excel document, refer to [this runnable how-to example]({% slug howto_multiplegridexport_aspnetmvcgrid %}).
235237
{% endif %}
@@ -238,25 +240,25 @@ For more information on how to export multiple Grids to a separate Excel sheet i
238240
239241
To export huge datasets to Excel, use the [RadSpreadStreamProcessing library](https://docs.telerik.com/devtools/document-processing/libraries/radspreadstreamprocessing/overview) which is part of [Telerik Document Processing (TDP) by Progress](https://docs.telerik.com/devtools/document-processing/introduction).
240242
241-
> The {{ site.framework }} version is in development. For updates, check [this](https://feedback.telerik.com/document-processing/1356226-document-processing-provide-version-for-net-core) feature request.
243+
> The {{ site.framework }} version is in development. For updates, refer to [this feature request](https://feedback.telerik.com/document-processing/1356226-document-processing-provide-version-for-net-core).
242244
243-
## Exclude Column From Exporting
245+
## Excluding Columns from Exporting
244246
245-
In some scenarios, you might want to hide given column or multiple columns from being exported. This can be achieved using the [Exportable](https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/columns.exportable) setting.
247+
In some scenarios, you might want to hide given column or multiple columns from being exported. This can be achieved using the [`Exportable`](https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/columns.exportable) setting.
246248
247249
```HtmlHelper
248250
columns.Bound(p => p.ProductName).Exportable(false);
249251
```
250252

251-
It can also be set in a detailed fashion containing different values for Excel and PDF exporting modes, providing separate options for each:
253+
You can also set `Exportable` in a detailed fashion to include different values for Excel and PDF exporting modes, providing separate options for each:
252254

253255
```HtmlHelper
254256
columns.Bound(p => p.ProductName).Exportable(x=> x.Pdf(true).Excel(false));
255257
```
256258

257-
In some scenarios, you want to include columns instead of excluding them. You may have columns defined in the grid which are not displayed in View mode, but you'd like to show them in the exported file. In this case, setting `.Exportable(true)` will not work automatically. You can rather try using `.Exportable(x=> x.Pdf(false).Excel(true));` specifically.
259+
In some scenarios, you may want to include instead of exclude columns. You can have defined Grid columns which are not displayed in the View mode and show them in the exported file. In this case, setting `.Exportable(true)` will not work automatically and you'll need to specifically use `.Exportable(x=> x.Pdf(false).Excel(true));`.
258260

259-
It is also important to understand the difference between .Hidden() and .Visible() properties of a grid column. The first one will hide the column only visually using CSS. The second one will cause the column not to be rendered at all.
261+
It is also important to note the difference between the `.Hidden()` and `.Visible()` properties of a Grid column. `.Hidden()` will hide the column only visually by using CSS. `.Visible()` will prevent the column from rendering at all.
260262

261263

262264
## Known Limitations

docs-aspnet/html-helpers/data-management/grid/how-to/editing/custom-popup-editor.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,36 @@ previous_url: /helpers/data-management/grid/how-to/editing/custom-popup-editor
66
slug: howto_usecustompopupeditors_gridaspnetmvc
77
---
88

9-
# Use Custom Popup Editors
9+
# Customize the Popup Editors in the Grid
1010

11-
To see the example, refer to the project on how to [customize the popup editor of the Kendo UI Grid when the mode is configured to `popup`](https://github.com/telerik/ui-for-aspnet-mvc-examples/tree/master/grid/custom-popup-editor).
11+
The Grid provides an option for editing its data in a popup. You can modify the popup window by using templates.
12+
13+
To customize it the popup editor:
14+
15+
1. Declare the name of the file that will render the content of the popup window by using the [`TemplateName`](https://docs.telerik.com/{{ site.platform }}/api/Kendo.Mvc.UI.Fluent/GridEditingSettingsBuilder#templatenamesystemstring) extension method.
16+
17+
```
18+
@(Html.Kendo().Grid<TelerikProject.Models.Customer>()
19+
.Name("grid")
20+
.Editable(e=>e.Mode(GridEditMode.PopUp).TemplateName("CustomPopUp"))
21+
...
22+
```
23+
24+
2. Create the editor template file. Its name must match the one declared in the `TemplateName()` configuration. By default, the editor templates that the Grid is using are located in the `~/Views/Shared/EditorTemplates` directory. Save the new template in this directory too.
25+
26+
3. Implement the new editor template.
27+
28+
```CustomPopUp.cshtml
29+
@model TelerikProject.Models.Customer
30+
31+
@Html.Kendo().TextBoxFor(m => m.ContactName)
32+
@Html.Kendo().NumericTextBoxFor(m => m.Age)
33+
@Html.Kendo().TextBoxFor(m => m.Country)
34+
```
35+
36+
For a full example, refer to the project on how to [customize the popup editor of the Kendo UI Grid when the mode is configured to `popup`](https://github.com/telerik/ui-for-aspnet-mvc-examples/tree/master/grid/custom-popup-editor).
1237
1338
## See Also
1439
1540
* [Overview of the Grid HtmlHelper]({% slug htmlhelpers_grid_aspnetcore_overview %})
16-
* [GridBuilder API Reference](https://docs.telerik.com/aspnet-mvc/api/Kendo.Mvc.UI.Fluent/GridBuilder)
41+
* [GridBuilder API Reference](https://docs.telerik.com/{{ site.platform }}/api/Kendo.Mvc.UI.Fluent/GridBuilder)

docs-aspnet/html-helpers/data-management/grid/overview.md

Lines changed: 49 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -52,47 +52,46 @@ The following example demonstrates how to define the Grid.
5252
```
5353
{% if site.core %}
5454
```TagHelper
55-
<kendo-grid name="grid"></kendo-grid>
55+
<kendo-grid name="grid">
56+
<columns>
57+
<column field="ContactName" width="140"></column>
58+
<column field="ContactTitle" width="190"></column>
59+
<column field="CompanyName"></column>
60+
<column field="Country" width="110"></column>
61+
</columns>
62+
<datasource type="DataSourceTagHelperType.Ajax">
63+
<transport>
64+
<read url="@Url.Action("Customers_Read","Grid")"/>
65+
</transport>
66+
</datasource>
67+
</kendo-grid>
5668
```
5769
{% endif %}
5870
```Controller
59-
namespace Kendo.Mvc.Examples.Controllers
71+
public class GridController : Controller
6072
{
61-
public partial class GridController : BaseController
73+
public ActionResult Customers_Read([DataSourceRequest] DataSourceRequest request)
6274
{
63-
[Demo]
64-
public IActionResult Index()
75+
var result = Enumerable.Range(0, 50).Select(i => new Customer
6576
{
66-
return View();
67-
}
68-
69-
public IActionResult Customers_Read([DataSourceRequest] DataSourceRequest request)
70-
{
71-
return Json(GetCustomers().ToDataSourceResult(request));
72-
}
77+
CompanyName = "Company Name " + i,
78+
ContactName = "Contact Name " + i,
79+
ContactTitle = "Contact Title " + i,
80+
Country = "Coutry " + i
81+
});
7382
74-
private static IEnumerable<CustomerViewModel> GetCustomers()
75-
{
76-
using (var northwind = new SampleEntitiesDataContext())
77-
{
78-
return northwind.Customers.Select(customer => new CustomerViewModel
79-
{
80-
CustomerID = customer.CustomerID,
81-
CompanyName = customer.CompanyName,
82-
ContactName = customer.ContactName,
83-
ContactTitle = customer.ContactTitle,
84-
Address = customer.Address,
85-
City = customer.City,
86-
Region = customer.Region,
87-
PostalCode = customer.PostalCode,
88-
Country = customer.Country,
89-
Phone = customer.Phone,
90-
Fax = customer.Fax,
91-
Bool = customer.Bool
92-
}).ToList();
93-
}
94-
}
95-
}
83+
var dsResult = result.ToDataSourceResult(request);
84+
return Json(dsResult);
85+
}
86+
}
87+
```
88+
```Customer.cs
89+
public class Customer
90+
{
91+
public string ContactName { get; set; }
92+
public string CompanyName { get; set; }
93+
public string Country { get; set; }
94+
public string ContactTitle { get; set; }
9695
}
9796
```
9897

@@ -192,7 +191,6 @@ The Grid configuration options are passed as attributes of the helper. The Grid
192191
* [Globalization]({% slug globalization_grid_aspnetcore %})
193192
* [Accessibility]({% slug accessibility_aspnetcore_grid %})
194193

195-
For more information on implementing specific scenarios, refer to the [**Knowledge Base**](/knowledge-base) section.
196194

197195
## Events
198196

@@ -267,13 +265,28 @@ You can subscribe to all Grid events and then use them to further customize the
267265
## Referencing Existing Instances
268266

269267
To refer to an existing Grid instance, use the [`jQuery.data()`](https://api.jquery.com/jQuery.data/) method. Once a reference is established, use the [Grid client-side API](https://docs.telerik.com/kendo-ui/api/javascript/ui/grid#methods) to control its behavior.
270-
268+
```
271269
<script>
272270
$(function() {
273271
// The Name() of the Grid is used to get its client-side instance.
274272
var grid = $("#grid").data("kendoGrid");
275273
});
276274
</script>
275+
```
276+
277+
## Learning Resources
278+
279+
* [Knowledge Base](/knowledge-base)
280+
{% if site.core %}
281+
* [Forum Discussions](https://www.telerik.com/forums/aspnet-core-ui?tagId=753)
282+
* [Demos](https://demos.telerik.com/aspnet-core/grid)
283+
{% endif %}
284+
{% if site.mvc %}
285+
* [Forum Discussions](https://www.telerik.com/forums/aspnet-mvc?tagId=754)
286+
* [Demos](https://demos.telerik.com/aspnet-mvc/grid)
287+
{% endif %}
288+
* [How-To Examples](https://github.com/telerik/ui-for-aspnet-mvc-examples/tree/master/grid)
289+
277290

278291
## See Also
279292

0 commit comments

Comments
 (0)