Skip to content

Commit b3050f2

Browse files
chore(Grid): address comments and polish samples
1 parent 8a967a8 commit b3050f2

File tree

2 files changed

+28
-44
lines changed

2 files changed

+28
-44
lines changed

components/grid/toolbar.md

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ position: 45
1212

1313
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).
1414

15-
## Built-in Tools
15+
## Built-In Tools
1616

17-
By default, the [Blazor Grid](https://demos.telerik.com/blazor-ui/grid/overview) does not automatically render all built-in tools when a toolbar is added. To include specific tools in a [toolbar configuration](#toolbar-tools-configuration), you need to explicitly define them using the tool tags below.
17+
By default, the [Blazor Grid](https://demos.telerik.com/blazor-ui/grid/overview) does not automatically render all built-in tools when a toolbar is added. To include specific tools in a [toolbar configuration](#toolbar-tools-configuration), you need to explicitly define them using the respective tool tags below.
1818

1919
### Command Tools
2020

@@ -35,7 +35,7 @@ By default, the [Blazor Grid](https://demos.telerik.com/blazor-ui/grid/overview)
3535

3636
## Custom Tools
3737

38-
In addition to built-in tools, the Grid also supports custom tools. Use the `<GridToolBarCustomTool>` tag, which is a standard Blazor `RenderFragment`. See the example below.
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.
3939

4040
## Toolbar Tools Configuration
4141

@@ -151,7 +151,9 @@ Add a `<GridToolBar>` tag inside `<TelerikGrid>` to configure a toolbar, for exa
151151

152152
## Custom Toolbar Configuration
153153

154-
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).
154+
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).
155+
156+
Note that when using `<GridToolBarTemplate>`, you need to use the `Tab` key to navigate through the items. This is because the `<GridToolBarTemplate>` allows rendering of custom elements, unlike `<GridToolBar>`, where the default keyboard navigation between tools is handled using the arrow keys.
155157

156158
>caption Custom Grid Toolbar
157159
@@ -161,24 +163,14 @@ Add a `<GridToolBarTemplate>` tag inside `<TelerikGrid>` to configure a custom t
161163
<TelerikGrid Data=@MyData Pageable="true" PageSize="15" EditMode="@GridEditMode.Inline" Height="500px" OnCreate="@CreateHandler">
162164
163165
<GridToolBarTemplate>
164-
<div style="display: block; flex-grow: 1;">
165-
@* the first level children in the toolbar get display: inline-flex and flex-shrink: 0 inherited from the grid,
166-
we change it here to show we can, or you can work with the layout the grid defines if it suits your needs *@
167-
168-
<div style="background:yellow">
169-
<GridCommandButton Command="Add" Icon="@SvgIcon.Plus">Add Employee</GridCommandButton>
170-
</div>
171-
<div style="background: green;">
172-
<TelerikDropDownList Data="@( new List<string>() { "first", "second", "third" } )" TValue="string" TItem="string" ValueChanged="@( (string itm) => result = itm )"></TelerikDropDownList>
173-
</div>
174-
175-
<div style="border: 1px solid red;">
176-
@* one example of aligning content to the right with flex *@
177-
<button style="display: flex; margin-left: auto;"
178-
@onclick="@( () => result = $"Custom button click on {DateTime.Now}" )">
179-
Click me
180-
</button>
181-
</div>
166+
<div style="display: flex; width: 100%; justify-content: space-between;">
167+
<GridCommandButton Command="Add" Icon="@SvgIcon.Plus">
168+
Add Employee
169+
</GridCommandButton>
170+
171+
<button @onclick="@( () => result = $"Custom button click on {DateTime.Now}" )">
172+
Click Me
173+
</button>
182174
</div>
183175
</GridToolBarTemplate>
184176

components/treelist/toolbar.md

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Toolbar
33
page_title: TreeList - Toolbar
4-
description: Use toolbar and custom actions in treelist for Blazor.
4+
description: Use toolbar and custom actions in Treelist for Blazor.
55
slug: treelist-toolbar
66
tags: telerik,blazor,treelist,toolbar
77
published: True
@@ -12,9 +12,9 @@ position: 45
1212

1313
The [Blazor TreeList](https://demos.telerik.com/blazor-ui/treelist/overview) toolbar can render built-in and custom tools. This article describes the built-in tools and shows how to add custom tools or [customize the toolbar](#custom-toolbar-configuration).
1414

15-
## Built-in Tools
15+
## Built-In Tools
1616

17-
By default, the [Blazor TreeList](https://demos.telerik.com/blazor-ui/treelist/overview) displays all its built-in tools in the order below. Use the tool tag if you need to define a tool explicitly in a [toolbar configuration](#toolbar-tools-configuration).
17+
By default, the [Blazor TreeList](https://demos.telerik.com/blazor-ui/treelist/overview) displays all its built-in tools in the order below. Use the respective tool tag if you need to define a tool explicitly in a [toolbar configuration](#toolbar-tools-configuration).
1818

1919
### Command Tools
2020

@@ -33,7 +33,7 @@ By default, the [Blazor TreeList](https://demos.telerik.com/blazor-ui/treelist/o
3333

3434
## Custom Tools
3535

36-
In addition to built-in tools, the TreeList also supports custom tools. Use the `<TreeListToolBarCustomTool>` tag, which is a standard Blazor `RenderFragment`. See the example below.
36+
In addition to the built-in tools, the TreeList also supports custom tools. Use the `<TreeListToolBarCustomTool>` tag, which is a standard Blazor `RenderFragment`. See the example below.
3737

3838
## Toolbar Tools Configuration
3939

@@ -228,6 +228,8 @@ Add a `<TreeListToolBar>` tag inside `<TelerikTreeList>` to configure a toolbar,
228228

229229
Add a `<TreeListToolBarTemplate>` tag inside `<TelerikTreeList>` to configure a custom toolbar. You can add your own HTML and components to create a more complex layout in the TreeList header to match your business needs and also `TreeListCommandButton` instances (read more about the features available in those buttons in the [Command Column](slug://treelist-columns-command) article).
230230

231+
Note that when using `<TreeListToolBarTemplate>`, you need to use the `Tab` key to navigate through the items. This is because the `<TreeListToolBarTemplate>` allows rendering of custom elements, unlike `<TreeListToolBar>`, where the default keyboard navigation between tools is handled using the arrow keys.
232+
231233
>caption Custom TreeList Toolbar
232234
233235
````RAZOR
@@ -238,24 +240,14 @@ Add a `<TreeListToolBarTemplate>` tag inside `<TelerikTreeList>` to configure a
238240
<TelerikTreeList Data="@Data" Pageable="true" ItemsField="@(nameof(Employee.DirectReports))" Width="850px">
239241
240242
<TreeListToolBarTemplate>
241-
<div style="display: block; flex-grow: 1;">
242-
@* the first level children in the toolbar get display: inline-flex and flex-shrink: 0 inherited from the grid,
243-
we change it here to show we can, or you can work with the layout the grid defines if it suits your needs *@
244-
245-
<div style="background:yellow">
246-
<TreeListCommandButton Command="Add" Icon="@SvgIcon.Plus">Add Employee</TreeListCommandButton>
247-
</div>
248-
<div style="background: green;">
249-
<TelerikDropDownList Data="@( new List<string>() { "first", "second", "third" } )" TValue="string" TItem="string" ValueChanged="@( (string itm) => result = itm )"></TelerikDropDownList>
250-
</div>
251-
252-
<div style="border: 1px solid red;">
253-
@* one example of aligning content to the right with flex *@
254-
<button style="display: flex; margin-left: auto;"
255-
@onclick="@( () => result = $"Custom button click on {DateTime.Now}" )">
256-
Click me
257-
</button>
258-
</div>
243+
<div style="display: flex; width: 100%; justify-content: space-between; align-items: center;">
244+
<TreeListCommandButton Command="Add" Icon="@SvgIcon.Plus">
245+
Add Employee
246+
</TreeListCommandButton>
247+
248+
<button @onclick="@( () => result = $"Custom button click on {DateTime.Now}" )">
249+
Click Me
250+
</button>
259251
</div>
260252
</TreeListToolBarTemplate>
261253

0 commit comments

Comments
 (0)