Problem creating a radio button with RadButton

2 posts, 0 answers
  1. Donald Norris
    Donald Norris avatar
    66 posts
    Member since:
    Mar 2006

    Posted 13 Sep 2012 Link to this post

    In the attached code I copied directly from your code in demos to create a radio button from a RadButton.  I cannot get it to work.  Please tell me what I did wrong. 

    Thanks.
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="TestBed2.aspx.vb" Inherits="TestBed2" %>
     
    <!DOCTYPE html>
     
    <head runat="server">
        <title></title>
        <style type="text/css">
            .classDiv
            {
                float: left;
                width: 150px;
            }
            .clear
            {
                width: 100%;
                clear: both;
                height: 110px;
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
            <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
            </telerik:RadStyleSheetManager>
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
                <Scripts>
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js">
                    </asp:ScriptReference>
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js">
                    </asp:ScriptReference>
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js">
                    </asp:ScriptReference>
                </Scripts>
            </telerik:RadScriptManager>
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            </telerik:RadAjaxManager>
        <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>
            </div>
        </form>
    </body>
    </html>
  2. Slav
    Admin
    Slav avatar
    1356 posts

    Posted 18 Sep 2012 Link to this post

    Hi Donald,

    Please note that a radio RadButton as well as a standard radio button is designed to function in a group of buttons of that type in order to enable a selection of a single item from a list. If you add several RadButtons with ToggleType="Radio" and with property GroupName set to StandardButton (the same as that of the button control on your page) the radio buttons will work as expected.

    This is shown in the online demo Radios and Checkboxes, from which you copied your code. As you can check the radio RadButtons are grouped by three and you can check only one at a time.

    Feel free to contact us again if you encounter more difficulties.

    Greetings,
    Slav
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top