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
In addition to the [main filtering options]({%slug components/grid/filtering%}), you can add a search box in the grid toolbar that lets the user type their query and the grid will look up all visible string columns with a case-insensitive `Contains` operator, and filter them accordingly. You can change the filter delay, and the fields the grid will use - see the [Customize the SearchBox](#customize-the-searchbox) section below.
13
+
In addition to the [main filtering options]({%slug components/grid/filtering%}), you can add a SearchBox in the Grid Toolbar.
14
14
15
-
The search box is independent from the standard filters. If you have filters applied, the searchbox will amend and respect them. Thus, you can also apply filtering to results returned from the search box.
15
+
>caption In this article:
16
16
17
-
To enable the search box, add the `<GridSearchBox>` tag in the `<GridToolBar>`.
17
+
*[Basics](#basics)
18
+
*[Filter From Code](#filter-from-code)
19
+
*[Customize the SearchBox](#customize-the-searchbox)
18
20
19
-
>caption Search box in the Telerik grid
21
+
22
+
## Basics
23
+
24
+
The SearchBox lets the user type their query and the grid will look up all visible string columns with a case-insensitive `Contains` operator, and filter them accordingly. You can change the filter delay, and the fields the grid will use - see the [Customize the SearchBox](#customize-the-searchbox) section below.
25
+
26
+
The SearchBox is independent from the standard filters. If you have filters applied, the SearchBox will respect them and add additional filtering criteria. Thus, you can also apply filtering to results returned from it.
27
+
28
+
To enable the SearchBox, add the `<GridSearchBox>` tag in the `<GridToolBar>`.
@@ -77,11 +88,11 @@ You can set the Grid filters programmatically through the component [state]({%sl
77
88
78
89

79
90
80
-
>caption Set programmatically Searchbox Filter.
91
+
>caption Set programmatically SearchBox Filter.
81
92
82
93
````Razor
83
-
@* This snippet shows how to set filtering state to the grid from your code.
84
-
Applies to the Searchbox filter *@
94
+
@* This snippet shows how to set filtering state to the Grid from your code.
95
+
Applies to the SearchBox filter *@
85
96
86
97
@using Telerik.DataSource;
87
98
@@ -152,20 +163,27 @@ You can set the Grid filters programmatically through the component [state]({%sl
152
163
153
164
The `GridSearchBox` component offers the following settings to customize its behavior:
154
165
155
-
*`DebounceDelay` - the time in `ms` with which the typing is debounced. This provides a performance optimization when using the `OnRead` event - filtering does not happen on every keystroke anymore. The default value is `300`.
*`Fields` - a `List<string>` that includes the fields names that the Grid should search in. By default, the Grid searches in all string fields, which are bound to visible columns. You can only define a subset of those fields. It is also possible to programmatically [search in string fields, which are not displayed in the Grid]({%slug grid-kb-search-in-hidden-fields%}).
168
+
| Attribute | Type and Default Value | Description |
169
+
|----------|----------|----------|
170
+
| `Class` | `string`| a CSS class rendered on the wrapper of the searchbox so you can customize its appearance.
171
+
| `DebounceDelay` | `int` <br/> (300) | the time in milliseconds with which searching is debounced. This provides a performance optimization when using the `OnRead` event - filtering does not happen on every keystroke during fast typing.
172
+
| `Fields` | `List<string>` | The collection of fields to search in. By default, the Grid searches in all string fields, which are bound to visible columns. You can only define a subset of those fields. It is also possible to programmatically [search in string fields, which are not displayed in the Grid]({%slug grid-kb-search-in-hidden-fields%}).
173
+
| `Placeholder` | `string` <br/> (`Search...`(localized))| Specifies the placeholder attribute of the SearchBox component.
174
+
| `Width` | `string` | Specifies the width of the SearchBox component.
158
175
159
-
*`Class` - a CSS class rendered on the wrapper of the searchbox so you can customize its appearance.
160
176
161
-
>caption Customize the search box to have a long filter delay and to only use certain fields
177
+
>caption Customize the SearchBox to have a long filter delay, search in certain fields only and use a custom placeholder
162
178
163
179
````CSHTML
164
-
@* Increased delay and a subset of the columns are allowed for filtering *@
180
+
@* Increased delay, a subset of the columns are allowed for filtering and a custom placeholder *@
Copy file name to clipboardExpand all lines: components/treelist/filter/searchbox.md
+47-30Lines changed: 47 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,16 +10,27 @@ position: 20
10
10
11
11
# TreeList Toolbar Searchbox
12
12
13
-
In addition to the [main filtering options]({%slug treelist-filtering%}), you can add a search box in the treelist toolbar that lets the user type their query and the treelist will look up all visible string columns with a case-insensitive `Contains` operator, and filter them accordingly. You can change the filter delay, and the fields the grid will use - see the [Customize the SearchBox](#customize-the-searchbox) section below.
13
+
In addition to the [main filtering options]({%slug treelist-filtering%}), you can add a SearchBox in the TreeList Toolbar.
14
14
15
-
The search box is independent from the standard filters. If you have filters applied, the searchbox will amend and respect them. Thus, you can also apply filtering to results returned from the search box.
15
+
>caption In this article:
16
16
17
-
To enable the search box, add the `<TreeListSearchBox>` tag in the `<TreeListToolBar>`.
17
+
*[Basics](#basics)
18
+
*[Filter From Code](#filter-from-code)
19
+
*[Customize the SearchBox](#customize-the-searchbox)
18
20
19
-
>caption Search box in the Telerik treelist
21
+
22
+
## Basics
23
+
24
+
The SearchBox lets the user type their query and the TreeList will look up all visible string columns with a case-insensitive `Contains` operator, and filter them accordingly. You can change the filter delay, and the fields the TreeList will use - see the [Customize the SearchBox](#customize-the-searchbox) section below.
25
+
26
+
The SearchBox is independent from the standard filters. If you have filters applied, the SearchBox will respect them and add additional filtering criteria. Thus, you can also apply filtering to results returned from it.
27
+
28
+
To enable the SearchBox, add the `<TreeListSearchBox>` tag in the `<TreeListToolBar>`.
29
+
30
+
>caption SearchBox in the Telerik TreeList
20
31
21
32
````CSHTML
22
-
@* A search panel in the treelist toolbar *@
33
+
@* A search panel in the TreeList Toolbar *@
23
34
24
35
<TelerikTreeList Data="@Data"
25
36
ItemsField="@(nameof(Employee.DirectReports))"
@@ -127,7 +138,7 @@ You can set the TreeList filters programmatically through the component [state](
127
138
128
139
````Razor
129
140
@* This snippet shows how to set filtering state to the TreeList from your code
130
-
Applies to the Searchbox filter *@
141
+
Applies to the SearchBox filter *@
131
142
132
143
@using Telerik.DataSource;
133
144
@@ -257,22 +268,28 @@ You can set the TreeList filters programmatically through the component [state](
257
268
258
269
The `TreeListSearchBox` component offers the following settings to customize its behavior:
259
270
260
-
*`DebounceDelay` - the time in `ms` with which the typing is debounced. Filtering does not happen on every keystroke and that can reduce the flicker for the end user. The default value is `300`.
261
-
262
-
*`Fields` - a list of `string` that denotes the fields names that the gris should search in. By default, the treelist looks in all string fields in its currently visible columns, and you can define a subset of that.
*`Class` - a CSS class rendered on the wrapper of the searchbox so you can customize its appearance.
273
+
| Attribute | Type and Default Value | Description |
274
+
|----------|----------|----------|
275
+
| `Class` | `string` | a CSS class rendered on the wrapper of the searchbox so you can customize its appearance.
276
+
| `DebounceDelay` | `int` <br/> (300) |the time in milliseconds with which searching is debounced. Filtering does not happen on every keystroke and that can reduce the flicker for the end user.
277
+
| `Fields` |`List<string>` | The collection of fields to search in. By default, the component looks in all string fields in its currently visible columns, and you can define a subset of that.
278
+
| `Placeholder` | `string` <br/> (`Search...`(localized))| Specifies the placeholder attribute of the SearchBox component.
279
+
| `Width` | `string` | Specifies the width of the SearchBox component.
265
280
266
-
>caption Customize the search box to have a long filter delay and to only use certain fields
281
+
>caption Customize the SearchBox to have a long filter delay, search in certain fields only and use a custom placeholder
267
282
268
283
````CSHTML
269
-
@* See the TreeListSearchBox parameters *@
284
+
@* Increased delay, a subset of the columns are allowed for filtering and a custom placeholder *@
0 commit comments