Skip to content

Commit a34e4b4

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent 4bf7101 commit a34e4b4

File tree

5 files changed

+613
-16
lines changed

5 files changed

+613
-16
lines changed
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
---
2+
title: ButtonGroup
3+
page_title: ButtonGroup | Telerik UI for ASP.NET Core HtmlHelpers
4+
description: "Learn the basics when working with the ButtonGroup HtmlHelper for ASP.NET Core (MVC 6 or ASP.NET Core MVC)."
5+
slug: htmlhelpers_buttongroup_aspnetcore
6+
---
7+
8+
# ButtonGroup HtmlHelper Overview
9+
10+
The ButtonGroup HtmlHelper extension is a server-side wrapper for the [Kendo UI ButtonGroup](https://demos.telerik.com/kendo-ui/buttongroup/index) widget.
11+
12+
For more information on the HtmlHelper, refer to the article on the [ButtonGroup HtmlHelper for ASP.NET MVC](http://docs.telerik.com/aspnet-mvc/helpers/buttongroup/overview).
13+
14+
## Getting Started
15+
16+
### Initialization
17+
18+
The following example demonstrates how to initialize the ButtonGroup.
19+
20+
###### Example
21+
22+
```
23+
@(Html.Kendo().ButtonGroup()
24+
.Name("select-period")
25+
.Items(t =>
26+
{
27+
t.Add().Text("Month");
28+
t.Add().Text("Quarter");
29+
t.Add().Text("Year");
30+
}))
31+
```
32+
33+
## Icons
34+
35+
Kendo UI ButtonGroup provides a method for configuring icons - `.Icon()`.
36+
37+
###### Example
38+
39+
```
40+
@(Html.Kendo().ButtonGroup()
41+
.Name("player")
42+
.Items(t =>
43+
{
44+
t.Add().Icon("play");
45+
t.Add().Icon("pause");
46+
t.Add().Icon("stop");
47+
}))
48+
```
49+
50+
The above configuration is expected to produce the HTML output from the following example.
51+
52+
###### Example
53+
54+
<div class="k-button-group k-widget" data-role="buttongroup" id="player" role="group" tabindex="0">
55+
<span data-icon="play" aria-pressed="false" role="button" class="k-button k-button-icon">
56+
<span class="k-icon k-i-play"></span>
57+
</span>
58+
<span data-icon="pause" aria-pressed="false" role="button" class="k-button k-button-icon">
59+
<span class="k-icon k-i-pause"></span>
60+
</span>
61+
<span data-icon="stop" aria-pressed="false" role="button" class="k-button k-button-icon">
62+
<span class="k-icon k-i-stop"></span>
63+
</span>
64+
</div>
65+
66+
## Features
67+
68+
### Enable and Disable ButtonGroup
69+
70+
Kendo UI ButtonGroup can be configured to be initially disabled via its `.Enable()` setting. The ButtonGroup can also be disabled or enabled at any time with JavaScript by using its `.Enable()` method with a Boolean argument.
71+
72+
The example below demonstrates how to enable and disable the ButtonGroup.
73+
74+
The following example demonstrates how to use `.Enable()`.
75+
76+
###### Example
77+
78+
```
79+
80+
@(Html.Kendo().ButtonGroup()
81+
.Name("select-period")
82+
.Enable(false)
83+
.Items(t =>
84+
{
85+
t.Add().Text("Month");
86+
t.Add().Text("Quarter");
87+
t.Add().Text("Year");
88+
}))
89+
```
90+
91+
For more information on the [`enable` method of the ButtonGroup](http://docs.telerik.com/kendo-ui/api/javascript/ui/buttongroup#methods-enable), refer to the [API of the ButtonGroup control](http://docs.telerik.com/kendo-ui/api/javascript/ui/buttongroup).
92+
93+
### Index
94+
95+
Initially selected index of the Kendo UI ButtonGroup can be configured via its `index` property. An index could be selected via `select()` method with a Integer argument.
96+
97+
The example below demonstrates how to select a button by its index.
98+
99+
###### Example
100+
101+
```
102+
103+
@(Html.Kendo().ButtonGroup()
104+
.Name("select-period")
105+
.Index(1)
106+
.Items(t =>
107+
{
108+
t.Add().Text("Month");
109+
t.Add().Text("Quarter");
110+
t.Add().Text("Year");
111+
}))
112+
```
113+
114+
For more information on the [`index` setting of the ButtonGroup](http://docs.telerik.com/kendo-ui/api/javascript/ui/buttongroup#configuration-index), refer to the [API of the ButtonGroup control](http://docs.telerik.com/kendo-ui/api/javascript/ui/buttongroup).
115+
116+
117+
### Selection
118+
119+
Kendo UI ButtonGroup can restrict the numbers of Buttons that can be selected via its `.Selection()` property. It can be configured with `single` or `multiple` selection.
120+
121+
The following example demonstrates how to use `.Selection()`.
122+
123+
###### Example
124+
125+
```
126+
127+
@(Html.Kendo().ButtonGroup()
128+
.Name("select-period")
129+
.Selection("multiple")
130+
.Items(t =>
131+
{
132+
t.Add().Text("Month");
133+
t.Add().Text("Quarter");
134+
t.Add().Text("Year");
135+
}))
136+
```
137+
138+
For more information on the [`selection` setting of the ButtonGroup](http://docs.telerik.com/kendo-ui/api/javascript/ui/buttongroup#configuration-selection), refer to the [API of the ButtonGroup control](http://docs.telerik.com/kendo-ui/api/javascript/ui/buttongroup).
139+
140+
## Reference
141+
142+
### Existing Instances
143+
144+
For more information on how to access an instance, refer to the [introductory article on the ButtonGroup](http://docs.telerik.com/kendo-ui/controls/navigation/buttongroup/overview).
145+
146+
## See Also
147+
148+
* [JavaScript API Reference of the ButtonGroup](http://docs.telerik.com/kendo-ui/api/javascript/ui/buttongroup)
149+
* [ButtonGroup HtmlHelper for ASP.NET MVC](http://docs.telerik.com/aspnet-mvc/helpers/buttongroup/overview)
150+
* [ButtonGroup Official Demos](http://demos.telerik.com/aspnet-core/buttongroup/index)
151+
* [Overview of Telerik UI for ASP.NET Core]({% slug overview_aspnetmvc6_aspnetmvc %})
152+
* [Get Started with Telerik UI for ASP.NET Core in ASP.NET Core Projects]({% slug gettingstarted_aspnetmvc6_aspnetmvc %})
153+
* [Get Started with Telerik UI for ASP.NET Core in ASP.NET Core Projects on Linux]({% slug gettingstartedlinux_aspnetmvc6_aspnetmvc %})
154+
* [Known Issues with Telerik UI for ASP.NET Core]({% slug knownissues_aspnetmvc6_aspnetmvc %})

docs-aspnet-core/helpers/tag-helpers/upload.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ The following example demonstrates how to define the Upload by using the Upload
1616

1717
> **Important**
1818
>
19-
> A change in the Upload's tag names has been introduced in R1 2018, in order to ensure tag naming consistency across the Telerik UI for ASP.NET Core suite. Since R1 2018 release the `<kendo-upload-async-settings> tag name has been changed to `<async>`, `<kendo-upload-files>` to `<files>`, `<kendo-upload-file>` to `<file>`, `<kendo-upload-localization-settings>` to `<localization>`, `<kendo-upload-validation-settings>` to `<validation>`.
19+
> A change in the Upload's tag names has been introduced in R1 2018, in order to ensure tag naming consistency across the Telerik UI for ASP.NET Core suite. Since R1 2018 release the `<kendo-upload-async-settings>` tag name has been changed to `<async>`, `<kendo-upload-files>` to `<files>`, `<kendo-upload-file>` to `<file>`, `<kendo-upload-localization-settings>` to `<localization>`, `<kendo-upload-validation-settings>` to `<validation>`.
2020
2121
###### Example
2222

2323
<kendo-upload drop-zone="drop-zone1" name="test">
24-
<kendo-upload-async-settings auto-upload="true" />
25-
<kendo-upload-validation-settings allowed-extensions="@Model.Extensions" />
26-
<kendo-upload-files>
27-
<kendo-upload-file name="dummy" size="1024"/>
28-
</kendo-upload-files>
24+
<async auto-upload="true" />
25+
<validation allowed-extensions="@Model.Extensions" />
26+
<files>
27+
<file name="dummy" size="1024" />
28+
</files>
2929
</kendo-upload>
3030

3131

@@ -46,11 +46,11 @@ The Upload tag helper configuration options are passed as attributes of the tag
4646
```
4747
```tab-tagHelper
4848
<kendo-upload drop-zone="drop-zone1" name="test">
49-
<kendo-upload-async-settings auto-upload="true" />
50-
<kendo-upload-validation-settings allowed-extensions="@Model.Extensions" />
51-
<kendo-upload-files>
52-
<kendo-upload-file name="dummy" size="1024"/>
53-
</kendo-upload-files>
49+
<async auto-upload="true" />
50+
<validation allowed-extensions="@Model.Extensions" />
51+
<files>
52+
<file name="dummy" size="1024" />
53+
</files>
5454
</kendo-upload>
5555
```
5656

0 commit comments

Comments
 (0)