AUTHOR: Rumen Zhekov
DATE POSTED: December 14, 2017
You can get reference to all radio list items via the get_items() method and use the set_selected(false); method to reset their state. Note that this will reset it only on the client-side and transferring this reset to the server is not a feature available in the control. You can hack the control into thinking nothing is selected by resetting its _selectedIndex property to -1 and making it updateClientState().
<telerik:RadRadioButtonList ID=
"RadRadioButtonList1"
runat=
"server"
RepeatDirection=
"Horizontal"
>
<Items>
<telerik:ButtonListItem Text=
"Yes"
Selected=
"true"
Value=
></telerik:ButtonListItem>
"No"
</Items>
</telerik:RadRadioButtonList>
<asp:Button Text=
"Reset Radio List"
OnClientClick=
"resetRadioList(); return false;"
/>
<script type=
"text/javascript"
function
resetRadioList() {
var
radioButtonList = $find(
"<%=RadRadioButtonList1.ClientID%>"
);
//reset the appearane of the items
items = radioButtonList.get_items();
for
(
i = 0; i < items.length; i++) {
items[i].set_selected(
false
}
//transfer the no-items-selected state to the server code
radioButtonList._selectedIndex = -1;
radioButtonList.updateClientState();
</script>
<
telerik:RadRadioButtonList
ID
=
runat
RepeatDirection
Items
telerik:ButtonListItem
Text
Selected
Value
></
</
asp:Button
OnClick
"Reset_RadioList_Click"
protected
void
Reset_RadioList_Click(
object
sender, EventArgs e)
{
int
i = 0; i < RadRadioButtonList1.Items.Count; i++)
RadRadioButtonList1.Items[i].Selected =
;
Protected
Sub
ByVal
sender
As
Object
,
e
EventArgs)
For
i
Integer
= 0
To
RadRadioButtonList1.Items.Count - 1
RadRadioButtonList1.Items(i).Selected =
False
Next
End
Resources Buy Try