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 grid provides a toolbar where you can add a variety of actions that are not tied to a concrete row.
13
+
The [Blazor Grid](https://demos.telerik.com/blazor-ui/grid/overview) toolbar can render built-in and custom tools. This article describes the built-in tools and shows how to add [custom tools](#custom-tools) or create a [custom toolbar](#custom-toolbar-configuration).
14
14
15
-
To use a toolbar, define the `GridToolBarTemplate` tag of the grid. In it, you can use arbitrary HTML and components to get the desired layout, and also `GridCommandButton` instances in (you can read more about the features available in those buttons in the [Command Column](slug://components/grid/columns/command) article).
15
+
## Built-In Tools
16
16
17
-
>note The toolbar is not associated with an item from the data source. The `Item` field on the click event handler argument of a `GridCommandButton` will always be `null` and the `Edit`, `Update`, `Cancel` commands do not work with it.
17
+
The [Blazor Grid](https://demos.telerik.com/blazor-ui/grid/overview) provides several built-in tools that can be added to the component toolbar. To include a specific tool in the [toolbar configuration](#toolbar-tools-configuration), use the respective tool tags below.
| Add |`GridToolBarAddTool`| An add command that fires the [`OnAdd` event](slug://components/grid/editing/overview#events). |
26
+
| CsvExport |`GridToolBarCsvExportTool`| An export command for CSV files that fires the [`OnBeforeExport` event](slug://grid-export-events#onbeforeexport). |
27
+
| ExcelExport |`GridToolBarExcelExportTool`| An export command for Excel files that fires the [`OnBeforeExport` event](slug://grid-export-events#onbeforeexport). |
28
+
| SearchBox |`GridToolBarSearchBoxTool`| A searchbox that filters multiple Grid columns simultaneously. |
25
29
26
-
##Built-in Commands
30
+
### Layout Tools
27
31
28
-
The grid offers built-in commands that you can invoke through its toolbar. To use them, set the `Command` property of the button to the command name. The built-in command names are:
32
+
| Tool Name | Tool Tag | Description |
33
+
| --- | --- | --- |
34
+
| Spacer |`GridToolBarSpacerTool`| Consumes the available empty space and pushes the rest of the tools next to one another. |
29
35
30
-
*`Add` - starts [inserting a new item in the grid](slug://components/grid/editing/overview).
36
+
## Custom Tools
31
37
32
-
*`ExcelExport` - starts an [Excel export of the grid data](slug://grid-export-excel).
38
+
In addition to the built-in tools, the Grid also supports custom tools. Use the `<GridToolBarCustomTool>` tag, which is a standard Blazor `RenderFragment`. See the example below.
33
39
34
-
*`CsvExport` - starts an [CSV export of the grid data](slug://grid-export-csv).
40
+
## Toolbar Tools Configuration
35
41
42
+
Add a `<GridToolBar>` tag inside `<TelerikGrid>` to configure a toolbar, for example:
36
43
37
-
>caption How to insert a new item in the grid
44
+
* Arrange the Grid tools in a specific order;
45
+
* Remove some of the built-in tools;
46
+
* Add custom tools.
38
47
39
-
````RAZOR
40
-
@result
48
+
>important `<GridToolBar>` and `<GridToolBarTemplate>` cannot be used together in the same Grid instance.
Add a `<GridToolBarTemplate>` tag inside `<TelerikGrid>` to configure a custom toolbar. You can add your own HTML and components to create a more complex layout in the Grid header to match your business needs and also `GridCommandButton` instances (read more about the features available in those buttons in the [Command Column](slug://components/grid/columns/command) article).
209
155
210
-
## Custom Layout
156
+
When using a `<GridToolBarTemplate>`, you need to use the `Tab` key to navigate between the focusable items. This is because the `<GridToolBarTemplate>` allows rendering of custom elements. On the other hand, the `<GridToolBar>` uses the [built-in keyboard navigation](slug://accessibility-overview#keyboard-navigation) through arrow keys.
211
157
212
-
You can add your own HTML and components to create a more complex layout in the grid header to match your business needs. You can still use the grid command buttons, as well as other components and logic.
0 commit comments