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

[Solved] RadAjaxManager1.FocusControl(RadTextBox1.ClientID) not working?

3 Answers 197 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Remko
Top achievements
Rank 1
Remko asked on 26 Feb 2008, 07:08 PM
Still new to discovering the possibilities...:-)
I have a RadTextbox1 in an asp:panel which on first page load is set to invisible.
I have an image button that initiates a radmanager ajex request to update the panel, server behind code switches the visibility of the panel on, then  :-

RadAjaxManager1.FocusControl(RadTextBox1.ClientID);


The screen does a couple of flickers but the focus is still on the image button, not the text box.

Am i missing something here?

Kevin.

3 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 27 Feb 2008, 08:21 AM
Hello Kevin,

The different methods for setting focus in our input controls (depending on the context) are listed in this topic from the online documentation:

http://www.telerik.com/help/radcontrols/prometheus/?input_CommonFocus.html

Note that you need to append "_text" suffix at the end in order to reference the input element holding the text value.

Best regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Remko
Top achievements
Rank 1
answered on 27 Feb 2008, 10:10 AM
Excellent, thanks.
Out of interest, in error i changed my focus statement to :-

RadAjaxManager1.FocusControl(RadTextBox1.ClientID+

"_text");

which isn't documented as a possibility in the link that you specify.
Can you tell me what the difference is between the above and the recommended statement of :-

RadScriptManager1.SetFocus(RadTextBox1.ClientID+

"_text");

Kevin.

0
Accepted
Sebastian
Telerik team
answered on 27 Feb 2008, 11:59 AM
Hi Kevin,

Actually there should be no difference whether you use RadAjaxManager's FocusControl or ScriptManager's SetFocus method to set gain focus in your RadTextBox. Both methods serve the same purpose.

Best regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Ajax
Asked by
Remko
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Remko
Top achievements
Rank 1
Share this question
or