Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q2 2011 released 07/12/2011
select

Button / Radios and Checkboxes

Radio Buttons







Checkboxes







Three-State Checkboxes








  • RadButton Checkboxes and Radio Buttons

    The RadButton control provides an easy way to fully customize the look and feel of your check boxes and radio buttons. Any ButtonType (StandardButton, LinkButton and ToggleButton) can be turned into a check box, radio, or custom toggle button, by setting the ToggleType property to a value different than ButtonToggleType.None. Simply, set the ToggleType to ButtonToggleType.CheckBox and you get a button that looks like a StandardButton, or LinkButton, but behaves as a check box. Set the ToggleType to ButtonToggleType.Radio and you get a button that behaves like a radio button, but looks like a StandardButton, or LinkButton.
    The possibility to customize every single state of the RadButton, when used as a toggle, gives the developer even more power to further enhance his/her check boxes and radio buttons.

    1. Radio Buttons
    <telerik:RadButton ID="btnToggle" runat="server" ToggleType="Radio" ButtonType="StandardButton" GroupName="StandardButton">
     <ToggleStates>
       <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleRadioChecked" />
       <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleRadio" />
     </ToggleStates>
    </telerik:RadButton>


    2. Checkboxes
    <telerik:RadButton ID="btnToggle" runat="server" ToggleType="CheckBox" ButtonType="LinkButton">
     <ToggleStates>
       <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked" />
       <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleCheckbox" />
     </ToggleStates>
    </telerik:RadButton>


    3. Three-state check box
    <telerik:RadButton ID="btnToggle" runat="server" ToggleType="CustomToggle" ButtonType="StandardButton">
     <ToggleStates>
      <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleCheckbox" />
      <telerik:RadButtonToggleState Text="Filled" PrimaryIconCssClass="rbToggleCheckboxFilled" />
      <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked"
               CssClass="rbSkinnedButtonChecked" />
     </ToggleStates>
    </telerik:RadButton>

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="C#" AutoEventWireup="true" %>

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <qsf:HeadTag ID="Headtag1" runat="server" />
        <style type="text/css">
            .classDiv
            {
                float: left;
                width: 150px;
            }
            .clear
            {
                width: 100%;
                clear: both;
                height: 110px;
            }
        </style>
    </head>
    <body class="BODY">
        <form id="form1" runat="server">
        <qsf:Header ID="Header1" runat="server" NavigationLanguage="c#" />
        <telerik:RadScriptManager ID="ScriptManager1" runat="server" />
        <div class="clear">
            <qsf:InformationBox ID="RadioButtons" runat="server" Title="Radio Buttons" Width="400px"
                Style="padding-top: 15px">
            </qsf:InformationBox>
        </div>
        <div class="classDiv">
            <telerik:RadButton ID="RadButton16" runat="server" ToggleType="Radio" ButtonType="StandardButton"
                GroupName="StandardButton" AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleRadioChecked" />
                    <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleRadio" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
            <telerik:RadButton ID="RadButton17" runat="server" ToggleType="Radio" Checked="true"
                GroupName="StandardButton" ButtonType="StandardButton" AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleRadioChecked" />
                    <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleRadio" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
            <telerik:RadButton ID="RadButton18" runat="server" ToggleType="Radio" GroupName="StandardButton"
                ButtonType="StandardButton" AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleRadioChecked" />
                    <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleRadio" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
        </div>
        <div class="classDiv">
            <telerik:RadButton ID="RadButton19" runat="server" ToggleType="Radio" ButtonType="LinkButton"
                GroupName="LinkButton" AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleRadioChecked" />
                    <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleRadio" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
            <telerik:RadButton ID="RadButton20" runat="server" ToggleType="Radio" ButtonType="LinkButton"
                GroupName="LinkButton" Checked="true" AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleRadioChecked" />
                    <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleRadio" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
            <telerik:RadButton ID="RadButton21" runat="server" ToggleType="Radio" ButtonType="LinkButton"
                GroupName="LinkButton" AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleRadioChecked" />
                    <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleRadio" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
        </div>
        <div class="classDiv">
            <telerik:RadButton ID="RadButton22" runat="server" ToggleType="Radio" ButtonType="ToggleButton"
                GroupName="Radios" AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="Checked" />
                    <telerik:RadButtonToggleState Text="UnChecked" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
            <telerik:RadButton ID="RadButton23" runat="server" ToggleType="Radio" ButtonType="ToggleButton"
                Checked="true" GroupName="Radios" AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="Checked" />
                    <telerik:RadButtonToggleState Text="UnChecked" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
            <telerik:RadButton ID="RadButton24" runat="server" ToggleType="Radio" ButtonType="ToggleButton"
                GroupName="Radios" AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="Checked" />
                    <telerik:RadButtonToggleState Text="UnChecked" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
        </div>
        <div class="clear">
            <qsf:InformationBox ID="CheckBoxes" runat="server" Title="Checkboxes" Width="400px"
                Style="padding-top: 15px">
            </qsf:InformationBox>
        </div>
        <div class="classDiv">
            <telerik:RadButton ID="RadButton1" runat="server" ToggleType="CheckBox" ButtonType="StandardButton"
                AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked" />
                    <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleCheckbox" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
            <telerik:RadButton ID="RadButton2" runat="server" ToggleType="CheckBox" Checked="true"
                ButtonType="StandardButton" AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked" />
                    <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleCheckbox" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
            <telerik:RadButton ID="RadButton3" runat="server" ToggleType="CheckBox" ButtonType="StandardButton"
                AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked" />
                    <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleCheckbox" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
        </div>
        <div class="classDiv">
            <telerik:RadButton ID="RadButton4" runat="server" ToggleType="CheckBox" ButtonType="LinkButton"
                AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked" />
                    <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleCheckbox" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
            <telerik:RadButton ID="RadButton5" runat="server" ToggleType="CheckBox" ButtonType="LinkButton"
                Checked="true" AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked" />
                    <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleCheckbox" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
            <telerik:RadButton ID="RadButton6" runat="server" ToggleType="CheckBox" ButtonType="LinkButton"
                AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked" />
                    <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleCheckbox" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
        </div>
        <div class="classDiv">
            <telerik:RadButton ID="RadButton10" runat="server" ToggleType="CheckBox" ButtonType="ToggleButton"
                AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="Checked" />
                    <telerik:RadButtonToggleState Text="UnChecked" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
            <telerik:RadButton ID="RadButton14" runat="server" ToggleType="CheckBox" ButtonType="ToggleButton"
                Checked="true" AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="Checked" />
                    <telerik:RadButtonToggleState Text="UnChecked" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
            <telerik:RadButton ID="RadButton15" runat="server" ToggleType="CheckBox" ButtonType="ToggleButton"
                AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="Checked" />
                    <telerik:RadButtonToggleState Text="UnChecked" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
        </div>
        <div class="clear">
            <qsf:InformationBox ID="ThreeState" runat="server" Title="Three-State Checkboxes"
                Width="400px" Style="padding-top: 15px">
            </qsf:InformationBox>
        </div>
        <div class="classDiv">
            <telerik:RadButton ID="btnToggle1" runat="server" ToggleType="CustomToggle" ButtonType="StandardButton"
                AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleCheckbox" />
                    <telerik:RadButtonToggleState Text="Filled" PrimaryIconCssClass="rbToggleCheckboxFilled" />
                    <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked"
                        CssClass="rbSkinnedButtonChecked" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
            <telerik:RadButton ID="btnToggle2" runat="server" ToggleType="CustomToggle" ButtonType="StandardButton"
                AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleCheckbox" />
                    <telerik:RadButtonToggleState Text="Filled" PrimaryIconCssClass="rbToggleCheckboxFilled"
                        Selected="true" />
                    <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked"
                        CssClass="rbSkinnedButtonChecked" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
            <telerik:RadButton ID="btnToggle3" runat="server" ToggleType="CustomToggle" ButtonType="StandardButton"
                AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleCheckbox" />
                    <telerik:RadButtonToggleState Text="Filled" PrimaryIconCssClass="rbToggleCheckboxFilled" />
                    <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked"
                        CssClass="rbSkinnedButtonChecked" Selected="true" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
        </div>
        <div class="classDiv">
            <telerik:RadButton ID="RadButton7" runat="server" ToggleType="CustomToggle" ButtonType="LinkButton"
                AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleCheckbox" />
                    <telerik:RadButtonToggleState Text="Filled" PrimaryIconCssClass="rbToggleCheckboxFilled" />
                    <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked"
                        CssClass="rbLinkButtonChecked" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
            <telerik:RadButton ID="RadButton8" runat="server" ToggleType="CustomToggle" ButtonType="LinkButton"
                AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleCheckbox" />
                    <telerik:RadButtonToggleState Text="Filled" PrimaryIconCssClass="rbToggleCheckboxFilled"
                        Selected="true" />
                    <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked"
                        CssClass="rbLinkButtonChecked" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
            <telerik:RadButton ID="RadButton9" runat="server" ToggleType="CustomToggle" ButtonType="LinkButton"
                AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleCheckbox" />
                    <telerik:RadButtonToggleState Text="Filled" PrimaryIconCssClass="rbToggleCheckboxFilled" />
                    <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked"
                        CssClass="rbLinkButtonChecked" Selected="true" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
        </div>
        <div class="classDiv">
            <telerik:RadButton ID="RadButton11" runat="server" ToggleType="CustomToggle" ButtonType="ToggleButton"
                AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleCheckbox" />
                    <telerik:RadButtonToggleState Text="Filled" PrimaryIconCssClass="rbToggleCheckboxFilled" />
                    <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
            <telerik:RadButton ID="RadButton12" runat="server" ToggleType="CustomToggle" ButtonType="ToggleButton"
                AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleCheckbox" />
                    <telerik:RadButtonToggleState Text="Filled" PrimaryIconCssClass="rbToggleCheckboxFilled"
                        Selected="true" />
                    <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
            <telerik:RadButton ID="RadButton13" runat="server" ToggleType="CustomToggle" ButtonType="ToggleButton"
                AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleCheckbox" />
                    <telerik:RadButtonToggleState Text="Filled" PrimaryIconCssClass="rbToggleCheckboxFilled" />
                    <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked"
                        Selected="true" />
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <br />
        </div>
        <qsf:Footer runat="server" ID="Footer1" />
        </form>
    </body>
    </html>

Get more than expected!

 
 

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2024 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451