Skip to content

Commit efd08cd

Browse files
vveesseelliinnaapepinho24
authored andcommitted
docs(multiselect): Add Tag mode article
1 parent f1ded54 commit efd08cd

File tree

3 files changed

+106
-0
lines changed

3 files changed

+106
-0
lines changed

controls/multiselect/functionality/grouping.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,81 @@ position: 4
99
---
1010

1111

12+
# Grouping
13+
14+
**RadMultiSelect** can group its data source based on the **GroupByField** property.
15+
16+
The dropdown will show a header with the value of the field for each group, and a static header for the current group just below the column headers, so the user can see which group they are scrolling through regardless of the number of items in it.
17+
18+
You can customize the headers through their [templates]({%slug multiselect/functionality/templates%}).
19+
20+
Grouping requires binding the control to a web service, and grouping is performed on the client over the returned flat data.
21+
22+
>caption Example 1: Grouping in RadMultiSelect
23+
24+
````ASP.NET
25+
<telerik:RadMultiSelect ID="RadMultiSelect4" runat="server" Skin="Default"
26+
GroupByField="Country"
27+
DataTextField="ContactName" DataValueField="CustomerID"
28+
Filter="Contains" Placeholder="select from the dropdown or type"
29+
DropDownWidth="500" Height="400" Width="100%">
30+
<WebServiceSettings Select-ContentType="JSON" ServiceType="OData"
31+
Select-Url="https://demos.telerik.com/kendo-ui/service/Northwind.svc/Customers">
32+
</WebServiceSettings>
33+
<ColumnsCollection>
34+
<telerik:MultiColumnComboBoxColumn Field="CustomerID" Title="ID" />
35+
<telerik:MultiColumnComboBoxColumn Field="ContactName" Title="Name" />
36+
</ColumnsCollection>
37+
</telerik:RadMultiSelect>
38+
````
39+
40+
Web service binding creates a Kendo DataSource and applies the grouping settings to it automatically. You can create your own Kendo DataSource instance and provide local data to it. In such a case, you must also provide the grouping settings to the data source.
41+
42+
>caption Example 2: Grouping with local data and a Kendo DataSource
43+
44+
````ASP.NET
45+
<script>
46+
function OnLoad(sender, args) {
47+
var data = [
48+
{ id: 1, name: "one", color: "red" },
49+
{ id: 2, name: "two", color: "green" },
50+
{ id: 3, name: "three", color: "blue" },
51+
{ id: 4, name: "four", color: "red" }
52+
];
53+
54+
var kendoDs = new kendo.data.DataSource({
55+
data: data,
56+
//clone the original group settings from the server
57+
group: {
58+
field: sender.groupByField
59+
}
60+
});
61+
62+
sender.set_dataSource(kendoDs);
63+
}
64+
</script>
65+
66+
<telerik:RadMultiSelect ID="RadMultiSelect4" runat="server" Skin="Default"
67+
GroupByField="color" DataTextField="name" DataValueField="id"
68+
Filter="Contains" FilterFields="name, color"
69+
DropDownWidth="500" Height="400" Width="300px">
70+
<ColumnsCollection>
71+
<telerik:MultiColumnComboBoxColumn Field="id" Title="ID" />
72+
<telerik:MultiColumnComboBoxColumn Field="name" Title="Name" />
73+
<telerik:MultiColumnComboBoxColumn Field="color" Title="color" />
74+
</ColumnsCollection>
75+
<ClientEvents OnLoad="OnLoad" />
76+
</telerik:RadMultiSelect>
77+
````
78+
79+
80+
81+
## See Also
82+
83+
* [Live Demo - Grouping](multiselect/grouping/defaultcs.aspx)
84+
85+
* [Templates]({%slug multiselect/functionality/templates%})
86+
87+
* [Kendo Data Source Grouping Configuration](https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/group)
88+
89+

controls/multiselect/functionality/tag-mode.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,31 @@ tags: tags,tag,mode,client,customize
77
published: True
88
position: 3
99
---
10+
11+
# Tag Mode
12+
13+
**RadMultiSelect** provides options for displaying the items as individual (multiple) tags and as a single, summary tag. The available modes are (you can see them in **Figure 1**):
14+
* `Single` - renders only one tag that shows the number of the selected values
15+
* `Multiple` - renders a tag for every selected value. This is the default tag mode.
16+
17+
![multiselect-tag-modes](../images/multiselect-tag-mode.png)
18+
19+
Every `TagMode` has a specific `TagTemplate` value. You can control the content of the rendered tags by setting a custom a [TagTemplate]]({%slug multiselect/functionality/templates%}#tag-template) value.
20+
21+
>caption Example 1: RadMultiSelect with single tag mode
22+
23+
````ASP.NET
24+
<telerik:RadMultiSelect ID="RadMultiSelect1" runat="server" Filter="Contains" Width="240px"
25+
DataTextField="text" DataValueField="value" TagMode="Single">
26+
<Items>
27+
<telerik:MultiSelectItem Text="Apples" Value="1"></telerik:MultiSelectItem>
28+
<telerik:MultiSelectItem Text="Oranges" Value="2"></telerik:MultiSelectItem>
29+
<telerik:MultiSelectItem Text="Bananas" Value="3"></telerik:MultiSelectItem>
30+
<telerik:MultiSelectItem Text="Cherries" Value="4"></telerik:MultiSelectItem>
31+
</Items>
32+
</telerik:RadMultiSelect>
33+
````
34+
35+
## See Also
36+
37+
* [Live Demo - Tag Mode](https://localdemos.telerik.com/aspnet-ajax-dev/multiselect/tagmode/defaultcs.aspx)
5.36 KB
Loading

0 commit comments

Comments
 (0)