Skip to content

Commit 3539abf

Browse files
kb: update change grid icons kb (#1521)
* kb: update change grid icons kb * chore: applying suggested changes * Update knowledge-base/grid-change-expand-collapse-icons.md Co-authored-by: Yordan <60105689+yordan-mitev@users.noreply.github.com> * Update knowledge-base/grid-change-expand-collapse-icons.md Co-authored-by: Yordan <60105689+yordan-mitev@users.noreply.github.com> --------- Co-authored-by: Yordan <60105689+yordan-mitev@users.noreply.github.com>
1 parent 77a899c commit 3539abf

File tree

1 file changed

+41
-2
lines changed

1 file changed

+41
-2
lines changed

knowledge-base/grid-change-expand-collapse-icons.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,29 @@ You can change the expand/collapse [icons]({%slug general-information/font-icons
3131
````CSHTML
3232
@*Change the icons in the Hierarchical Grid*@
3333
34+
35+
@*If your Telerik.UI.for.Blazor version is 4.3.0 or later, use the following CSS.*@
36+
3437
<style>
38+
.custom-icons .k-hierarchy-cell .k-svg-icon.k-svg-i-minus svg path{
39+
d: path("M256 352 128 160h256L256 352z");
40+
}
41+
.custom-icons .k-hierarchy-cell .k-svg-icon.k-svg-i-plus svg path{
42+
d: path("M352 256 160 384V128l192 128z");
43+
}
44+
</style>
45+
46+
@*If your Telerik.UI.for.Blazor version is below 4.3.0, use this CSS.*@
47+
48+
@* <style>
3549
.custom-icons .k-hierarchy-cell .k-icon.k-i-plus::before {
3650
content: "\e005";
3751
}
3852
3953
.custom-icons .k-hierarchy-cell .k-icon.k-i-minus::before {
4054
content: "\e006";
4155
}
42-
</style>
56+
</style> *@
4357
4458
<TelerikGrid Class="custom-icons" Data="salesTeamMembers" @ref="Grid"
4559
OnStateInit="@( (GridStateEventArgs<MainModel> args) => OnStateInit(args))">
@@ -103,9 +117,34 @@ You can change the expand/collapse [icons]({%slug general-information/font-icons
103117
}
104118
````
105119

120+
>The SVG icons customization does not work in the Safari browser. As a workaround, hide the SVG icons and use font icons instead.
121+
122+
>caption Replace the SVG icons with Font icons
123+
```
124+
125+
<style>
126+
.custom-icons .k-hierarchy-cell .k-svg-icon svg {
127+
display:none;
128+
}
129+
.custom-icons .k-hierarchy-cell .k-svg-icon.k-svg-i-plus:before {
130+
content: "\e005";
131+
font-family: "WebComponentsIcons";
132+
}
133+
.custom-icons .k-hierarchy-cell .k-svg-icon.k-svg-i-minus:before {
134+
content: "\e006";
135+
font-family: "WebComponentsIcons";
136+
}
137+
</style>
138+
139+
```
140+
106141
>caption Change the built-in expand/collapse icons. The result of the code snippet above.
107142
108143
![Hierarchical Grid with changed expand/collapse icons](images/grid-change-expand-collapse-icons-example.png)
109144

110145
## Notes
111-
To get the desired icons, you can use your dev tools to inspect the rendered icon you want and get its content. Also, you can use any custom icons that are not from the Telerik font (e.g., icons from Bootstrap, Open Iconic, and so on) by specifying the desired font name in addition to the content.
146+
To get the desired icons, you can use your dev tools to inspect the rendered icon that you want to use and get its content/path. Also, you can use any custom icons that are not from the Telerik icons package (e.g., icons from Bootstrap, Open Iconic, and so on) by specifying the desired font name in addition to the content.
147+
148+
## See Also
149+
150+
* [Font and SVG Icons]({%slug general-information/font-icons%})

0 commit comments

Comments
 (0)