Skip to content

Commit d389514

Browse files
docs(multiselect): Improve checkbox selection KB (#1404)
Co-authored-by: Dimo Dimov <[email protected]>
1 parent b35261f commit d389514

File tree

1 file changed

+23
-11
lines changed

1 file changed

+23
-11
lines changed

knowledge-base/multiselect-checkbox-in-dropdown.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@ page_title: Checkbox in MultiSelect
66
slug: multiselect-kb-checkbox-in-dropdown
77
position:
88
tags:
9-
ticketid: 1453142
9+
ticketid: 1453142, 1606291
1010
res_type: kb
1111
---
1212

1313
## Environment
14+
1415
<table>
15-
<tbody>
16-
<tr>
17-
<td>Product</td>
18-
<td>MultiSelect for Blazor</td>
19-
</tr>
20-
</tbody>
16+
<tbody>
17+
<tr>
18+
<td>Product</td>
19+
<td>MultiSelect for Blazor</td>
20+
</tr>
21+
</tbody>
2122
</table>
2223

2324

@@ -78,19 +79,19 @@ The MultiSelect offers a highlighted state for the selected items already, yet i
7879

7980
You can add a "Select All" feature through the `HeaderTemplate` - it only has to update the `Value` collection accordingly (empty, or to have all the items in the `Data`).
8081

81-
Here is one example:
82+
>caption Select all MultiSelect items with a checkbox
8283
8384
````CSHTML
8485
@* Note: If you use complex models, the GetChecked() method will be more complex and
8586
you would need to implement another convention for the id attribute, and you would need to cast the context *@
8687
8788
<TelerikMultiSelect @ref="MultiSelectRef"
88-
Data="@Roles"
89+
Data="@Roles"
8990
@bind-Value="@TheValues"
9091
AutoClose="false"
9192
Placeholder="Write the roles you need">
9293
<HeaderTemplate>
93-
<label style="padding: 4px 8px;">
94+
<label class="select-all-item">
9495
<TelerikCheckBox TValue="bool"
9596
Value="@IsAllSelected()"
9697
ValueChanged="@( (bool v) => ToggleSelectAll(v) )">
@@ -111,6 +112,18 @@ Here is one example:
111112
112113
</TelerikMultiSelect>
113114
115+
<style>
116+
.select-all-item {
117+
padding: 4px 8px;
118+
display: block;
119+
cursor: pointer;
120+
}
121+
122+
.select-all-item:hover {
123+
background: rgba(0, 0, 0, 0.06);
124+
}
125+
</style>
126+
114127
@foreach (var item in TheValues)
115128
{
116129
<div>@item</div>
@@ -154,4 +167,3 @@ Here is one example:
154167
};
155168
}
156169
````
157-

0 commit comments

Comments
 (0)