Skip to content

Commit 5031f39

Browse files
author
User Jenkins
committed
Sync with Kendo UI Professional
1 parent 3598e56 commit 5031f39

File tree

12 files changed

+122
-5
lines changed

12 files changed

+122
-5
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Each `Filterable` configuration of the columns allows the setting of a custom Da
2727
);
2828
.ShowIndexes(true))
2929

30+
> Only columns that are [bound to a field](https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/columns.field) can be filterable. To enable filtering on a column bound to an object, [bind the column to a field of that object](https://docs.telerik.com/aspnet-core/knowledge-base/grid-enable-operations-for-object-column).
31+
3032
## Filter Modes
3133

3234
The Grid supports the following filter modes:

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ To control grouping in the Grid, use the [`Groupable()`](https://docs.telerik.co
1919
.Groupable()
2020
...
2121

22+
> Only columns that are [bound to a field](https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/columns.field) can be groupable. To enable grouping on a column bound to an object, [bind the column to a field of that object](https://docs.telerik.com/aspnet-core/knowledge-base/grid-enable-operations-for-object-column).
23+
2224
You can also render groups by setting group expressions in the DataSource of the Grid even without enabling `Groupable`.
2325

2426
.Name("Grid")

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ To control the sorting in the Grid, use the `Sortable` option.
1919
.Sortable()
2020
...
2121

22+
> Only columns that are [bound to a field](https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/columns.field) can be sortable. To enable sorting on a column bound to an object, [bind the column to a field of that object](https://docs.telerik.com/aspnet-core/knowledge-base/grid-enable-operations-for-object-column).
23+
2224
## Sort Modes
2325

2426
The Grid supports single and multiple columns sort modes which can be set through its `SortMode` property. You can also specify if the columns can be unsorted by setting the `AllowUnsort` property to `true` or `false`. For a runnable example, refer to the [demo on sorting in the Grid](https://demos.telerik.com/{{ site.platform }}/grid/sorting).

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,13 @@ The following example demonstrates how to define the DataSource by using the Dat
4949

5050
## Basic Configuration
5151

52-
You can declare the DataSource HtmlHelper configuration options by using the available methods—for example, you can define the page size, page, sort order, filter, group, aggregates, and the model. The configuration accepts the definition for all CRUD operations and facilitates the sending of additional data such as the `AntiForgeryTokens`.
52+
You can declare the DataSource HtmlHelper configuration options by using the available methods—for example, you can define the page size, page, sort order, filter, group, aggregates, and the model.
53+
54+
> * To [sort](https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/sort#sort) the data based on an object, set [the data field, by which the data items are sorted,](https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/sort#sortfield) to a property of that object.
55+
> * To [group](https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/group) the data by an object, set [the group by data item field](https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/group#groupfield) to a property of that object.
56+
> * To [filter](https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/filter) the data based on an object, set [the data item field, to which the filter operator is applied,](https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/filter#filterfield) to a property of that object.
57+
58+
The configuration accepts the definition for all CRUD operations and facilitates the sending of additional data such as the `AntiForgeryTokens`.
5359

5460
@(Html.AntiForgeryToken())
5561

docs-aspnet/knowledge-base/grid-enable-operations-for-object-column.md

Lines changed: 86 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,95 @@ component: grid
2020

2121
## Description
2222

23-
How can I enable sorting, filtering, and grouping for a column which holds complex object values in the Grid HtmlHelper?
23+
How can I enable sorting, filtering, and grouping for a column which holds complex object values by using the Grid HtmlHelper?
2424

2525
## Solution
2626

27+
- Enable the sorting, grouping, and filtering through the `.Sortable()`, `.Groupable()`, and `.Filterable()` methods.
28+
- The `Product` Model has a `Category` property, which is a Model with `CategoryID` and `CategoryName` properties. Bind the column to the `CategoryName` property.
29+
30+
```View
31+
@model ProjectName.Models
32+
33+
@(Html.Kendo().Grid<Product>()
34+
.Name("grid")
35+
.Columns(columns =>
36+
{
37+
columns.Bound(product => product.ProductID);
38+
columns.Bound(product => product.Category.CategoryName);
39+
})
40+
.Pageable()
41+
.Sortable()
42+
.Filterable()
43+
.Groupable()
44+
.DataSource(dataSource => dataSource
45+
.Ajax()
46+
.Read(read => read.Action("Read", "Grid"))
47+
)
48+
)
49+
```
50+
```Models
51+
using System;
52+
using System.Collections.Generic;
53+
using System.Linq;
54+
using System.Threading.Tasks;
55+
56+
public class Product
57+
{
58+
public int ProductID { get; set; }
59+
public Category Category { get; set; }
60+
}
61+
62+
public class Category
63+
{
64+
public int CategoryID { get; set; }
65+
66+
public string CategoryName { get; set; }
67+
}
68+
```
69+
```Controller
70+
using System;
71+
using System.Collections.Generic;
72+
using System.Linq;
73+
using System.Threading.Tasks;
74+
using ProjectName.Models;
75+
using Kendo.Mvc.Extensions;
76+
using Kendo.Mvc.UI;
77+
using Microsoft.AspNetCore.Mvc;
78+
79+
public class GridController : Controller
80+
{
81+
private static ICollection<Product> products;
82+
83+
public GridController()
84+
{
85+
if (products == null)
86+
{
87+
var random = new Random();
88+
products = Enumerable.Range(1, 100).Select(x => new Product
89+
{
90+
ProductID = x,
91+
Category = new Category
92+
{
93+
CategoryID = x,
94+
CategoryName = "Category" + x
95+
}
96+
97+
}).ToList();
98+
}
99+
}
100+
public IActionResult GridController()
101+
{
102+
return View();
103+
}
104+
105+
public ActionResult Read([DataSourceRequest] DataSourceRequest request)
106+
{
107+
return Json(products.ToDataSourceResult(request));
108+
}
109+
}
110+
```
111+
27112
For the complete implementation on how to enable sorting, filtering, and grouping in a Kendo UI Grid for ASP.NET Core when a Grid column represents complex object values, refer to [this GitHub project](https://github.com/telerik/ui-for-aspnet-core-examples/blob/master/Telerik.Examples.Mvc/Telerik.Examples.Mvc/Views/Grid/EnableOperationsForObjectColumn.cshtml) demonstrates how to.
28113

29114
## See Also

docs-aspnet/tag-helpers/datasource/overview.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ The following example demonstrates how to define the DataSource by using the Dat
2525

2626
The DataSource TagHelper configuration options are passed as attributes of the tag. The DataSource is an abstraction for binding the Kendo UI widgets to local and remote data and to handle various data operations with the `databound` Tag Helpers.
2727

28+
> * To [sort](https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/sort#sort) the data based on an object, set [the data field, by which the data items are sorted,](https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/sort#sortfield) to a property of that object.
29+
> * To [group](https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/group) the data by an object, set [the group by data item field](https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/group#groupfield) to a property of that object.
30+
> * To [filter](https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/filter) the data based on an object, set [the data item field, to which the filter operator is applied,](https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/filter#filterfield) to a property of that object.
31+
2832
```tagHelper
2933
<kendo-datasource name="dataSource" type="DataSourceTagHelperType.Ajax" server-operation="false" page-size="5">
3034
<transport>

docs/controls/data-management/grid/filtering.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ By default, the filtering functionality of the Kendo UI Grid is disabled.
1212

1313
To control filtering in the Grid, use the `filterable` property.
1414

15+
> Only columns that are [bound to a field](https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/columns.field) can be filterable. To enable filtering on a column bound to an object, [bind the column to a field of that object](https://docs.telerik.com/kendo-ui/knowledge-base/enable-operations-for-object-column).
16+
1517
The Grid enables you to implement the following filter options:
1618
* [Header row filtering](#filtering-by-rows)
1719
* [Filtering by checkboxes](#filtering-by-checkboxes)

docs/controls/data-management/grid/grouping/overview.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ To sort the grouped content, click the grouping tab. To toggle the sort order of
3131

3232
![Grid Grouped by Last Name](../grid6_1.png)
3333

34+
> Only columns that are [bound to a field](https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/columns.field) can be groupable. To enable grouping on a column bound to an object, [bind the column to a field of that object](https://docs.telerik.com/kendo-ui/knowledge-base/enable-operations-for-object-column).
35+
3436
## Using with Row Templates
3537

3638
A row template explicitly defines the row markup while grouping requires you to change the row markup. To use the two features simultaneously, include a script in the row template which adds additional cells depending on the number of the existing groups.

docs/controls/data-management/grid/sorting.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ To enhance the performance of the Grid, apply the sorting operations on the serv
2222

2323
![Grid with Sorting Enabled](grid7_1.png)
2424

25+
> Only columns that are [bound to a field](https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/columns.field) can be sortable. To enable sorting on a column bound to an object, [bind the column to a field of that object](https://docs.telerik.com/kendo-ui/knowledge-base/enable-operations-for-object-column).
26+
2527
## Sort Modes
2628

2729
The Grid supports the following sort modes:

docs/framework/datasource/overview.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ The [Kendo UI DataSource component](https://demos.telerik.com/kendo-ui/datasourc
1515

1616
The DataSource is an abstraction for using local data (arrays of JavaScript objects) or remote data (web services returning JSON, JSONP, [oData](http://www.odata.org/) or XML). It fully supports CRUD (Create, Read, Update, Destroy) data operations and provides both client-side and server-side support for sorting, paging, filtering, grouping, and aggregates.
1717

18+
> * To [sort](https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/sort#sort) the data based on an object, set [the data field, by which the data items are sorted,](https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/sort#sortfield) to a property of that object.
19+
> * To [group](https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/group) the data by an object, set [the group by data item field](https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/group#groupfield) to a property of that object.
20+
> * To [filter](https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/filter) the data based on an object, set [the data item field, to which the filter operator is applied,](https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/filter#filterfield) to a property of that object.
21+
1822
The following list includes some of the functionality and features which the DataSource provides. For detailed information on the capabilities of the DataSource, refer to its [configuration API, methods, and events](/api/javascript/data/datasource), and [demos](https://demos.telerik.com/kendo-ui/datasource/index).
1923

2024
* [Retrieval of data from a remote endpoint](/framework/datasource/cors).

0 commit comments

Comments
 (0)