Skip to content

Commit 4b71abd

Browse files
docs(multiSelect): templates
1 parent 914a057 commit 4b71abd

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed
10.5 KB
Loading
11.6 KB
Loading
11.6 KB
Loading

components/multiselect/templates.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ position: 5
1010

1111
# MultiSelect Templates
1212

13-
The AutoComplete component allows you to change what is rendered in its items, header and footer through templates.
13+
The MultiSelect component allows you to change what is rendered in its items, header and footer through templates.
1414

15-
The examples below show how to use inner tags to set the templates. You can also do this through [RenderFragment](https://blazor.net/api/Microsoft.AspNetCore.Blazor.RenderFragment.html) objects that you can pass to the properties of the AutoComplete in its main tag.
15+
The examples below show how to use inner tags to set the templates. You can also do this through [RenderFragment](https://blazor.net/api/Microsoft.AspNetCore.Blazor.RenderFragment.html) objects that you can pass to the properties of the MultiSelect in its main tag.
1616

1717
List of the available templates:
1818

@@ -30,52 +30,52 @@ The Item template determines how the individual items are rendered in the dropdo
3030
````CSHTML
3131
@* Define what renders for the items in the dropdown *@
3232
33-
<TelerikAutoComplete Data="@Suggestions" @bind-Value="@Role" Placeholder="Write your position">
33+
<TelerikMultiSelect Data="@Roles" @bind-Value="@TheValues" Placeholder="Write the roles you need">
3434
<ItemTemplate>
35-
Are you a&nbsp;<strong>@context</strong>
35+
Maybe a&nbsp;<strong>@context</strong>
3636
</ItemTemplate>
37-
</TelerikAutoComplete>
37+
</TelerikMultiSelect>
3838
3939
@code{
40-
string Role { get; set; }
40+
List<string> TheValues { get; set; } = new List<string>();
4141
42-
List<string> Suggestions { get; set; } = new List<string> {
42+
List<string> Roles { get; set; } = new List<string> {
4343
"Manager", "Developer", "QA", "Technical Writer", "Support Engineer", "Sales Agent", "Architect", "Designer"
4444
};
4545
}
4646
````
4747

4848
>caption The result from the code snippet above
4949
50-
![](images/autocomplete-item-template.png)
50+
![](images/multiselect-item-template.png)
5151

5252
## Header
5353

54-
The header is content that you can place above the list of items inside the dropdown element. It is always visible when the combobox is expanded. By default it is empty.
54+
The header is content that you can place above the list of items inside the dropdown element. It is always visible when the multiselect is expanded. By default it is empty.
5555

5656
>caption Header Example
5757
5858
````CSHTML
5959
@* Define a header in the dropdown *@
6060
61-
<TelerikAutoComplete Data="@Suggestions" @bind-Value="@Role" Placeholder="Write your position">
61+
<TelerikMultiSelect Data="@Roles" @bind-Value="@TheValues" Placeholder="Write the roles you need">
6262
<HeaderTemplate>
63-
<strong>Write your own if you don't see it in the list</strong>
63+
<strong>Select one or more from the list</strong>
6464
</HeaderTemplate>
65-
</TelerikAutoComplete>
65+
</TelerikMultiSelect>
6666
6767
@code{
68-
string Role { get; set; }
68+
List<string> TheValues { get; set; } = new List<string>();
6969
70-
List<string> Suggestions { get; set; } = new List<string> {
70+
List<string> Roles { get; set; } = new List<string> {
7171
"Manager", "Developer", "QA", "Technical Writer", "Support Engineer", "Sales Agent", "Architect", "Designer"
7272
};
7373
}
7474
````
7575

7676
>caption The result from the code snippet above
7777
78-
![](images/autocomplete-header-template.png)
78+
![](images/multiselect-header-template.png)
7979

8080
## Footer
8181

@@ -86,24 +86,24 @@ The footer is content that you can place below the list of items inside the drop
8686
````CSHTML
8787
@* Define dropdown footer *@
8888
89-
<TelerikAutoComplete Data="@Suggestions" @bind-Value="@Role" Placeholder="Write your position">
89+
<TelerikMultiSelect Data="@Roles" @bind-Value="@TheValues" Placeholder="Write the roles you need">
9090
<FooterTemplate>
91-
<h5>Total Positions: @Suggestions.Count()</h5>
91+
<h5>Total New Positions: @TheValues?.Count()</h5>
9292
</FooterTemplate>
93-
</TelerikAutoComplete>
93+
</TelerikMultiSelect>
9494
9595
@code{
96-
string Role { get; set; }
96+
List<string> TheValues { get; set; } = new List<string>();
9797
98-
List<string> Suggestions { get; set; } = new List<string> {
98+
List<string> Roles { get; set; } = new List<string> {
9999
"Manager", "Developer", "QA", "Technical Writer", "Support Engineer", "Sales Agent", "Architect", "Designer"
100100
};
101101
}
102102
````
103103

104104
>caption The result from the code snippet above
105105
106-
![](images/autocomplete-footer-template.png)
106+
![](images/multiselect-footer-template.png)
107107

108108
## See Also
109109

0 commit comments

Comments
 (0)