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

SelectedToggleStateIndex

3 Answers 91 Views
This is a migrated thread and some comments may be shown as answers.
Erik
Top achievements
Rank 2
Erik asked on 23 Oct 2011, 01:39 PM
Hello,

Could anyone shed some light on the 'SelectedToggleStateIndex' and 'SelectedToggleState' properties??

It does not do anything here. 'SelectedToggleStateIndex' is always zero.

<telerik:RadButton ID="rbt_1" ButtonType="LinkButton" GroupName="0001" AutoPostBack="false" UseSubmitBehavior="False" ToggleType="Radio" Text="0-7" runat="server" />
<telerik:RadButton ID="rbt_2" ButtonType="LinkButton" GroupName="0001" AutoPostBack="false" UseSubmitBehavior="False" ToggleType="Radio" Text="8-27" runat="server" />
<telerik:RadButton ID="rbt_3" ButtonType="LinkButton" GroupName="0001" AutoPostBack="false" UseSubmitBehavior="False" ToggleType="Radio" Text="28-82" runat="server" />
<telerik:RadButton ID="rbt_4" ButtonType="LinkButton" GroupName="0001" AutoPostBack="false" UseSubmitBehavior="False" ToggleType="Radio" Text="83-100" runat="server" />

Thanks,

Erik

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 25 Oct 2011, 05:35 AM
Hello Erik,

The  SelectedToggleStateIndex property gets or sets the index of the currently selected ToggleState of the RadButton control, when used as a custom toggle button as shown below.
aspx:
<telerik:RadButton ID="rbt_1" runat="server" ButtonType="ToggleButton" ToggleType="CustomToggle">
</telerik:RadButton>

Thanks,
Princy.
0
Erik
Top achievements
Rank 2
answered on 25 Oct 2011, 10:59 AM
Hello Princy,

Yes, but that is just a radio button. I already had that. :-)

I think it would be logical that it also returns the selected index when I'm using a button or LinkedButton, don't you think so?

Erik
0
Accepted
Kevin
Top achievements
Rank 2
answered on 25 Oct 2011, 01:36 PM
Hello Erik,

In your example you have four different RadButtons on your page, so the ToggleStateIndex will always return 0 because their is no other state contained in the button. The ToggleStateIndex only works if the button is used as a ToggleButton like so:

<telerik:RadButton ID="RadButton3" runat="server" ButtonType="ToggleButton" Checked="true">
<ToggleStates>
    <telerik:RadButtonToggleState Text="Checked" Selected="true" />
    <telerik:RadButtonToggleState Text="Unchecked" />
</ToggleStates>
</telerik:RadButton>

As you can see, the toggle states of the RadButton are specified within the button itself and is not multiple button controls.

You can see it on this demo how the toggle button functionality works:

http://demos.telerik.com/aspnet-ajax/button/examples/togglebutton/defaultcs.aspx

I hope that helps.
Asked by
Erik
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 1
Erik
Top achievements
Rank 2
Kevin
Top achievements
Rank 2
Share this question
or