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

Three-State Checkbox - only two states when clicking?

3 Answers 390 Views
Button
This is a migrated thread and some comments may be shown as answers.
JP
Top achievements
Rank 1
JP asked on 07 Dec 2012, 04:36 PM
Hello,

I added some three-state checkboxes like in the demo:

<telerik:RadButton ID="btnToggle" runat="server" ToggleType="CustomToggle" ButtonType="ToggleButton">
 <ToggleStates>
  <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleCheckbox" />
  <telerik:RadButtonToggleState Text="Filled" PrimaryIconCssClass="rbToggleCheckboxFilled" />
  <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked" />
 </ToggleStates>
</telerik:RadButton>

This works fine, but I want to disable the "Filled" state when clicking.
I want to set all three states server-side, but the user shouldn't be able to use the "Filled" state - he should be able to just switch between "unchecked" and "checked".

How can I achieve this?

Thanks!

3 Answers, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 11 Dec 2012, 02:11 PM
Hello,

There aren't any properties for setting the visibility of RadButtonToggleState in RadButton. However you can dynamically add/remove ToggleStates when needed.

I have created a simple VS example showing how to add/remove filled ToggleState through clicking on the adjacent RadButton and retaining the state in CommandName property. If the example provided does not fulfill your requirements, could you please explain what exactly is your scenario?

All the best,
Danail Vasilev
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.
0
SK
Top achievements
Rank 1
answered on 08 Jul 2014, 08:27 PM
Hi Danial,

Even I have the same situation as JP. Is there any property to disble the filled state from clicking. I just need only checked and unchecked states for the user to click. Can you please help me.

Thanks,
SK.
0
Shinu
Top achievements
Rank 2
answered on 09 Jul 2014, 07:21 AM
Hi SK,

I guess you need only two states for the ToggleButton, Checked and Unchecked. Please modify the above ASPX code snippet as follow which will show only two toggle state.

ASPX:
<telerik:RadButton ID="rbtnToggle" runat="server" ToggleType="CustomToggle" ButtonType="ToggleButton">
    <ToggleStates>
        <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleCheckbox" />
        <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked" />
    </ToggleStates>
</telerik:RadButton>

Please elaborate your requirement if it doesn't help.
Thanks,
Shinu.
Tags
Button
Asked by
JP
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
SK
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or