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

.get_text() doesn't work on toggle?

2 Answers 50 Views
Button
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 11 Jan 2011, 07:13 PM
In the Clicking event I'm trying to get the text of the button, but sender.get_text() is giving me an empty string

Button is defined like this
<telerik:RadButton ID="showInputButton" runat="server" ButtonType="StandardButton" ToggleType="CustomToggle" AutoPostBack="False" ForeColor="Black" CommandArgument='<%# Eval("pdrid") %>' OnClientClicking="OnToggleInputClicking">
                                <ToggleStates>
                                    <telerik:RadButtonToggleState PrimaryIconCssClass="rbAdd" Text="Show" />
                                    <telerik:RadButtonToggleState PrimaryIconCssClass="rbRemove" Text="Hide" />
                                </ToggleStates>
                            </telerik:RadButton>

Am I doing something wrong?

2 Answers, 1 is accepted

Sort by
0
Accepted
Cori
Top achievements
Rank 2
answered on 12 Jan 2011, 02:14 PM
Hello Steve,

I have to assume to get the text of a toggle button, you have to do it this way:

sender.get_selectedToggleState().get_text()

I hope that helps.
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 12 Jan 2011, 02:25 PM
Oh yes, you would be right!

I did not see that function in the list, I just stopped at get_text
Tags
Button
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Cori
Top achievements
Rank 2
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Share this question
or