ASP.NET MVC CheckBoxGroup Overview
The CheckBoxGroup is part of Telerik UI for ASP.NET MVC, a
professional grade UI library with 110+ components for building modern and feature-rich applications. To try it out sign up for a free 30-day trial.
The Telerik UI CheckBoxGroup HtmlHelper for ASP.NET MVC is a server-side wrapper for the Kendo UI CheckBoxGroup widget.
The CheckBoxGroup allows to style and provide checkbox functionality to list elements, set the position of the labels, attributes and custom css classes.
Initializing the CheckBoxGroup
The following example demonstrates how to define the CheckBoxGroup.
@(Html.Kendo().CheckBoxGroup()
.Name("checkboxgroup")
)
Basic Configuration
The following example demonstrates the basic configuration for the CheckBoxGroup.
@(Html.Kendo().CheckBoxGroup()
.Name("checkboxgroup")
.Items(i =>
{
i.Add().Label("Spain").Value("1");
i.Add().Label("Italy").Value("2");
i.Add().Label("UK").Value("3");
})
.Value(new string[] { "1" })
)
<script>
$(function() {
// The Name() of the CheckBoxGroup is used to get its client-side instance.
var checkboxgroup = $("#checkboxgroup").data("kendoCheckBoxGroup");
});
</script>
Functionality and Features
-
Binding—You can bind the CheckBoxGroup's items by using its
Items
configuration method or theBindTo
method to bind to a view model. - Label—The CheckBoxGroup allows you to customize the text and appearance of its labels.
-
Layout—The CheckBoxGroup supports two types of layout -
horizontal
andvertical
.
Next Steps
- Getting Started with the CheckBoxGroup
- Basic Usage of the CheckBoxGroup HtmlHelper for ASP.NET MVC (Demo)