Hello, I need some help with a Telerik RadButton that I have set up to work like a checkbox. It's loading the OnCommand click event each time that it's clicked. I need it to be more of a on/off switch. More details below.
ButtonType="StandardButton" ToggleType="CheckBox"
Current state:
- normal state (notSelectedButton): clickable and loads OnCommand event when clicked.
- selected/checked state (selectedButton): clickable and loads OnCommand event when clicked.
What I need the button to do:
- normal state (notSelectedButton): stay the same - be clickable and load OnCommand="videoClicked" event.
- selected/checked state (selectedButton): be clickable but disable OnCommand event. I want it to go back to normal state (like an on/off switch).
My example code below shows what I have so far. I don't know if this should be done client side or code behind? Any suggestions are welcomed.
aspx code:
<ItemTemplate>
<div class="itemWrapper">
<telerik:RadButton
RenderMode="Lightweight"
runat="server"
OnCommand="videoClicked"
CommandArgument='<%# Eval("videoId") %>'
ButtonType="StandardButton"
ToggleType="CheckBox"
ID="RadToggleButton1"
AutoPostBack="true">
<ToggleStates>
<telerik:RadButtonToggleState SecondaryIconCssClass="rbOk" Text="Selected" Value="selectedButton"></telerik:RadButtonToggleState>
<telerik:RadButtonToggleState Text="Not Selected" Value="notSelectedButton"></telerik:RadButtonToggleState>
</ToggleStates>
</telerik:RadButton>
</div>
</ItemTemplate>