This is a migrated thread and some comments may be shown as answers.

Problem creating a radio button with RadButton

1 Answer 49 Views
Button
This is a migrated thread and some comments may be shown as answers.
Donald Norris
Top achievements
Rank 1
Donald Norris asked on 13 Sep 2012, 09:00 PM
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>

1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 18 Sep 2012, 09:44 AM
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.
Tags
Button
Asked by
Donald Norris
Top achievements
Rank 1
Answers by
Slav
Telerik team
Share this question
or