ASP.net has had a bug with the RadioButton controls running inside of templates since 1.0. I wanted to use the RadButton as a replacement for the standard RadioButton. I have multiple Radbuttons (in Radio mode) being built by a RadListView. When the result is rendered, I get radio buttons that don't participate as if in a Group ( You can select all the radio buttons ).
Same thing happens to ASP.net RadioButtons. In the past I've hacked around this with custom RadioButton classes that handle outputting the propert ID to the client with respect the GroupName property. Also, I've done the client side javascript hack.
This is such a common hack in ASP.net I was hoping the Telerik RadButton would just work in this situation.
Here's an example of me using the Radbutton in a template:
What's the best way to get my RadButton's to act like proper RadioButton's (mutually exclusive selection)?
Also, this is .Net 4, so I have access to the new ClientIDMode. I tried switching it to static, and using a static ID, but it caused a JSON error later when i click on a button.
Same thing happens to ASP.net RadioButtons. In the past I've hacked around this with custom RadioButton classes that handle outputting the propert ID to the client with respect the GroupName property. Also, I've done the client side javascript hack.
This is such a common hack in ASP.net I was hoping the Telerik RadButton would just work in this situation.
Here's an example of me using the Radbutton in a template:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CheckListInputGroupView.ascx.cs" Inherits="ProjectCold.RadTest.WebApplication.Views.CheckListInputGroupView" %>
<%@ Import Namespace="ProjectCold.RadTest.WebApplication.Model" %>
<%@ Import Namespace="Telerik.Web.UI" %>
<
telerik:RadListView
ID
=
"RadListView"
runat
=
"server"
DataSource='<%#Bind("GroupItems")%>'
ItemPlaceholderID="GroupItemsHolder"
DataKeyNames="GroupItemID">
<
LayoutTemplate
>
<
fieldset
title='<%#Eval("ToolTip")%>'>
<
legend
><%#Eval("Caption")%></
legend
>
<
asp:Panel
ID
=
"GroupItemsHolder"
runat
=
"server"
/>
</
fieldset
>
</
LayoutTemplate
>
<
ItemTemplate
>
<
telerik:RadButton
runat
=
"server"
GroupName='<%#Eval("FK_CheckListInputID", "InputGroup{0}")%>'
Text='<%#Eval("Text")%>'
ButtonType="ToggleButton"
ToggleType='<%# ( (CheckListInputGroup.InputGroupTypes)Eval("CheckListInputGroup.InputGroupType") == CheckListInputGroup.InputGroupTypes.Radio ? ButtonToggleType.Radio : ButtonToggleType.CheckBox) %>'
/>
</
ItemTemplate
>
<
ItemSeparatorTemplate
>
<
br
/>
</
ItemSeparatorTemplate
>
</
telerik:RadListView
>
What's the best way to get my RadButton's to act like proper RadioButton's (mutually exclusive selection)?
Also, this is .Net 4, so I have access to the new ClientIDMode. I tried switching it to static, and using a static ID, but it caused a JSON error later when i click on a button.