Skip to content

Commit 90d9e84

Browse files
chore(grid): minor updates
1 parent ba15067 commit 90d9e84

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

components/grid/filtering.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,20 @@ position: 22
1010

1111
# Grid Filtering
1212

13-
The Grid component offers support for filtering.
13+
The Grid component offers built-in support for filtering.
1414

15-
To enable filtering, set the grid's `Filterable` property to `true`.
15+
To enable filtering, set the grid's `FilterMode` property to one of the following values:
1616

17-
There are two filtering modes:
18-
19-
* [`FilterRow`](#filter-row) (default) - a row of filter options is rendered below the column headers
20-
* [`FilterMenu`](#filter-menu) - the column headers render a button that shows a popup with filtering options
17+
* [`Telerik.Blazor.FilterMode.FilterRow`](#filter-row) - a row of filter options is rendered below the column headers
18+
* [`Telerik.Blazor.FilterMode.FilterMenu`](#filter-menu) - the column headers render a button that shows a popup with filtering options
2119

2220
The behavior of the filter input and the available filter operators will depend on the column data type. For example, a boolean field will only have the options "is true" and "is false" and will not have operators like "contains" or "greater than".
2321

2422
You can filter more than one column at a time, and all filter rules will be applied together with an `AND` logic.
2523

2624
## Filter Row
2725

28-
The filter row is the default filter behavior of the grid. It corresponds to setting the `FilterMode` property of the grid to `Telerik.Blazor.FilterMode.FilterMenu`.
26+
To enable the filter row set the `FilterMode` property of the grid to `Telerik.Blazor.FilterMode.FilterMenu`.
2927

3028
The grid will render a row below the column headers with UI that you can use to fill in the filter criteria. You can type in the input to execute the default operator as you type, or click a button to choose a different filter operator (like "contains", "greater than" and so on).
3129

@@ -36,7 +34,7 @@ Once a filter is a applied to a column, a button will appear that lets you clear
3634
````CSHTML
3735
@using Telerik.Blazor.Components.Grid
3836
39-
<TelerikGrid Data=@GridData Filterable="true" Pageable="true" Height="400px">
37+
<TelerikGrid Data=@GridData FilterMode="Telerik.Blazor.FilterMode.FilterRow" Pageable="true" Height="400px">
4038
<TelerikGridColumns>
4139
<TelerikGridColumn Field=@nameof(Employee.Name) />
4240
<TelerikGridColumn Field=@nameof(Employee.AgeInYears) Title="Age" />
-656 Bytes
Loading

components/grid/overview.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ To create a basic Telerik Grid:
2323
````CSHTML
2424
@using Telerik.Blazor.Components.Grid
2525
26-
<TelerikGrid Data="@MyData" Height="300px" Pageable="true" Sortable="true" Filterable="true">
26+
<TelerikGrid Data="@MyData" Height="300px"
27+
Pageable="true" Sortable="true"
28+
FilterMode="Telerik.Blazor.FilterMode.FilterRow">
2729
<TelerikGridColumns>
2830
<TelerikGridColumn Field="@(nameof(SampleData.Id))" />
2931
<TelerikGridColumn Field="@(nameof(SampleData.Name))" Title="Employee Name" />
@@ -67,7 +69,7 @@ The grid is a generic component, and to store a reference, you must use the mode
6769
````CSHTML
6870
@using Telerik.Blazor.Components.Grid
6971
70-
<TelerikGrid Data="@MyData" ref="theGridReference">
72+
<TelerikGrid Data="@MyData" @ref="theGridReference">
7173
<TelerikGridColumns>
7274
<TelerikGridColumn Field="@(nameof(SampleData.ID))">
7375
</TelerikGridColumn>
@@ -135,14 +137,19 @@ For example, you can benefit from the elastic design the components expose to ch
135137
@using Telerik.Blazor.Components.Grid
136138
137139
<style>
138-
div.smallerFont,
139-
div.smallerFont .k-filtercell * {
140-
font-size: 10px;
141-
}
140+
div.smallerFont,
141+
div.smallerFont .k-filtercell * {
142+
font-size: 10px;
143+
}
144+
145+
div.smallerFont .k-dropdown.k-header.k-dropdown-operator {
146+
width: calc(8px + 2em) !important;
147+
}
142148
</style>
143149
144150
<TelerikGrid Data="@MyData" Class="smallerFont"
145-
Pageable="true" Filterable="true" Sortable="true" Height="200px">
151+
Pageable="true" FilterMode="Telerik.Blazor.FilterMode.FilterRow"
152+
Sortable="true" Height="200px">
146153
<TelerikGridColumns>
147154
<TelerikGridColumn Field="@(nameof(SampleData.ID))">
148155
</TelerikGridColumn>
@@ -156,7 +163,8 @@ For example, you can benefit from the elastic design the components expose to ch
156163
original:
157164
158165
<TelerikGrid Data="@MyData"
159-
Pageable="true" Filterable="true" Sortable="true" Height="200px">
166+
Pageable="true" FilterMode="Telerik.Blazor.FilterMode.FilterRow"
167+
Sortable="true" Height="200px">
160168
<TelerikGridColumns>
161169
<TelerikGridColumn Field="@(nameof(SampleData.ID))">
162170
</TelerikGridColumn>

0 commit comments

Comments
 (0)