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
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)
>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
+
21
74
## See Also
22
75
23
76
* [Incell Editing by the Grid HtmlHelper for {{ site.framework }} (Demo)](https://demos.telerik.com/{{ site.platform }}/grid/editing)
24
77
* [Inline Editing by the Grid HtmlHelper for {{ site.framework }} (Demo)](https://demos.telerik.com/{{ site.platform }}/grid/editing-inline)
25
78
* [Popup Editing by the Grid HtmlHelper for {{ site.framework }} (Demo)](https://demos.telerik.com/{{ site.platform }}/grid/editing-popup)
26
79
* [Custom Editor by the Grid HtmlHelper for {{ site.framework }} (Demo)](https://demos.telerik.com/{{ site.platform }}/grid/editing-custom)
27
80
* [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)
*[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).
23
22
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).
@@ -59,7 +60,7 @@ To enable the Excel export option of the Grid:
59
60
60
61
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.
61
62
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.
63
64
64
65
[HttpPost]
65
66
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
71
72
72
73
## Outputting the Result
73
74
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).
75
76
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).
77
78
78
79
> * 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).
81
82
82
83
## Exporting All Data
83
84
@@ -116,7 +117,7 @@ By default, the Telerik UI Grid for {{ site.framework }} exports only the curren
116
117
117
118
## Customizing Excel Documents
118
119
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 %}).
120
121
121
122
1. Attach an excel export handler.
122
123
@@ -129,7 +130,7 @@ The [`ExcelExport()`](/api/Kendo.Mvc.UI.Fluent/GridEventBuilder#excelexportsyste
129
130
)
130
131
```
131
132
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).
133
134
134
135
<script>
135
136
function excelExport(e) {
@@ -225,11 +226,12 @@ The [page on creating a custom number format](https://support.office.com/en-us/a
225
226
</script>
226
227
227
228
{% if site.mvc %}
228
-
## Use the Detail Template
229
+
230
+
## Using the Detail Template
229
231
230
232
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 %}).
231
233
232
-
## Export Multiple Grids
234
+
## Exporting Multiple Grids
233
235
234
236
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 %}).
235
237
{% endif %}
@@ -238,25 +240,25 @@ For more information on how to export multiple Grids to a separate Excel sheet i
238
240
239
241
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).
240
242
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).
242
244
243
-
## Exclude Column From Exporting
245
+
## Excluding Columns from Exporting
244
246
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.
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));`.
258
260
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.
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.
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).
12
37
13
38
## See Also
14
39
15
40
* [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)
For more information on implementing specific scenarios, refer to the [**Knowledge Base**](/knowledge-base) section.
196
194
197
195
## Events
198
196
@@ -267,13 +265,28 @@ You can subscribe to all Grid events and then use them to further customize the
267
265
## Referencing Existing Instances
268
266
269
267
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
+
```
271
269
<script>
272
270
$(function() {
273
271
// The Name() of the Grid is used to get its client-side instance.
0 commit comments