Skip to content

Commit 45c8da4

Browse files
ntachevaikoevska
andauthoredApr 29, 2025
chore(MultiSelect): Add documentarion for SummaryTagtemplate (#2913)
* chore(MultiSelect): Add documentarion for SummaryTagtemplate * Update components/multiselect/templates.md Co-authored-by: Iva Stefanova Koevska-Atanasova <koevska@progress.com> * Update components/multiselect/templates.md Co-authored-by: Iva Stefanova Koevska-Atanasova <koevska@progress.com> --------- Co-authored-by: Iva Stefanova Koevska-Atanasova <koevska@progress.com>
1 parent 44ad4e3 commit 45c8da4

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed
 

‎components/multiselect/templates.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ The MultiSelect component allows you to change what is rendered in its items, he
1616
1717
* [Item Template](#item-template)
1818
* [Tag Template](#tag-template)
19+
* [Summary Tag Template](#summary-tag-template)
1920
* [Header Template](#header-template)
2021
* [Footer Template](#footer-template)
2122
* [No Data Template](#no-data-template)
@@ -29,6 +30,14 @@ The MultiSelect component allows you to change what is rendered in its items, he
2930

3031
@[template](/_contentTemplates/dropdowns/templates.md#tag-template)
3132

33+
## Summary Tag Template
34+
35+
The `SummaryTagTemplate` controls the rendering of the summary tag. The Multiselect renders a summary tag in the following cases:
36+
* In [Single Tag Mode](slug:multiselect-tag-mode#single-mode).
37+
* In Multiple Tag Mode&mdash;[when the selected items are more than the `MaxAllowedTags`](slug:multiselect-tag-mode#summarized-tags-based-on-the-number-of-selections).
38+
39+
The context of the `SummaryTagTemplate` is of type `MultiSelectSummaryTagTemplateContext<TItem>`. It provides an `Items` field (a `List<TItem>`) that contains the selected items.
40+
3241
## Header Template
3342

3443
@[template](/_contentTemplates/dropdowns/templates.md#header-template)
@@ -46,7 +55,7 @@ The MultiSelect component allows you to change what is rendered in its items, he
4655
>caption Using MultiSelect Templates
4756
4857
````RAZOR
49-
@* MultiSelect component with HeaderTemplate, ItemTemplate, TagTemplate, FooterTemplate and NoDataTemplate *@
58+
@* MultiSelect component with HeaderTemplate, ItemTemplate, TagTemplate, SummaryTagTemplate, FooterTemplate and NoDataTemplate *@
5059
5160
<p>
5261
<TelerikCheckBox @bind-Value="@IsDataAvailable" OnChange="@OnCheckBoxChangeHandler" />
@@ -57,6 +66,7 @@ The MultiSelect component allows you to change what is rendered in its items, he
5766
@bind-Value="@SelectedRoles"
5867
TextField="Title"
5968
ValueField="Id"
69+
MaxAllowedTags="@MaxAllowedTags"
6070
Placeholder="Write the roles you need">
6171
<HeaderTemplate>
6272
<strong>Select one or more:</strong>
@@ -68,6 +78,9 @@ The MultiSelect component allows you to change what is rendered in its items, he
6878
<TelerikSvgIcon Icon="@context.Icon"></TelerikSvgIcon>
6979
@context.Title
7080
</TagTemplate>
81+
<SummaryTagTemplate>
82+
@(context.Items.Count() - MaxAllowedTags) more roles selected
83+
</SummaryTagTemplate>
7184
<FooterTemplate>
7285
<h6>Total Positions: @MultiSelectData.Count()</h6>
7386
</FooterTemplate>
@@ -80,11 +93,13 @@ The MultiSelect component allows you to change what is rendered in its items, he
8093
</TelerikMultiSelect>
8194
8295
@code {
83-
private List<int> SelectedRoles { get; set; }
96+
private List<int> SelectedRoles { get; set; } = new List<int>() { 1, 4, 5, 8 };
8497
8598
private bool IsDataAvailable { get; set; } = true;
8699
87-
private List<Role> MultiSelectData { get; set; }
100+
private int MaxAllowedTags { get; set; } = 2;
101+
102+
private List<Role> MultiSelectData { get; set; }
88103
89104
private List<Role> SourceData { get; set; } = new List<Role>()
90105
{

0 commit comments

Comments
 (0)