CheckBoxGroup Overview

Telerik UI for ASP.NET Core Ninja image

The CheckBoxGroup is part of Telerik UI for ASP.NET Core, 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 TagHelper and HtmlHelper for ASP.NET Core are server-side wrappers 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")
    )
     <kendo-checkboxgroup name="checkboxgroup"
            input-name="checkboxItem">
    </kendo-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>
    <kendo-checkboxgroup name="checkboxgroup">
        <kendo-checkboxgroup-items>
            <kendo-checkboxgroup-item value="one" label="Female"></kendo-checkboxgroup-item>
            <kendo-checkboxgroup-item value="two" label="Male"></kendo-checkboxgroup-item>
        </kendo-checkboxgroup-items>
    </kendo-checkboxgroup>

Functionality and Features

See Also

In this article