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

RadAjaxManagerProxy SettingFocus

6 Answers 187 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
NS
Top achievements
Rank 1
NS asked on 14 Jan 2008, 07:39 AM
Hello,
On the RadAjaxManager there is a method to set focus on a control after the ajax callback. (Setting Focus in Common Section on the examples site)

My question is how to do this if I use a RadAjaxManagerProxy. (my RadAjaxManager is on my Master Page, the Proxy on a usercontrol that refers the masterpage)

The .FocusControl is not available on the RadAjaxManagerProxy.

Thanks,
Nicolas

6 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 14 Jan 2008, 09:26 AM
Hi NS,

You can still use FocusControl() method of RadAjaxManager. Here is an example:

RadAjaxManager.GetCurrent(Page).FocusControl()

Best wishes,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
NS
Top achievements
Rank 1
answered on 14 Jan 2008, 09:35 AM
The RadAjaxManager is not known on my usercontrol.
It is the RadAjaxManagerProxy that handles the postback on the usercontrol: e.g.

<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">  
<AjaxSettings> 
    <telerik:AjaxSetting AjaxControlID="myDropDownList">  
        <UpdatedControls> 
            <telerik:AjaxUpdatedControl ControlID="myPanel" /> 
        </UpdatedControls> 
    </telerik:AjaxSetting> 
</AjaxSettings> 
</telerik:RadAjaxManagerProxy> 

So must I use the FocusControl method of my RadAjaxManager on my Parent Master Page to set focus on a dropdownlist on my usercontrol ?
0
Steve
Telerik team
answered on 14 Jan 2008, 12:03 PM
Hi NS,

That is correct. The RadAjaxManagerProxy is only used for easier control relations setting in user controls or content pages and does not implement all of the functionality that is available through the RadAjaxManager.
As my colleague pointed - you need to get a reference to the RadAjaxManager (RadAjaxManager.GetCurrent(Page)) and you can use its methods directly in the content page (not in the MasterPage as you guessed).

All the best,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
NS
Top achievements
Rank 1
answered on 07 Feb 2008, 12:21 PM
Steve,
You tell me to get a reference to RadAjaxmanager on my usercontrol.

Must this be done using FindControl ? (have you got an example to do that ?)

Thanks,
Nicolas
0
Konstantin Petkov
Telerik team
answered on 08 Feb 2008, 11:52 AM
Hello,

You will find an example attached to my response. I have demonstrated how the "master" manager can be got from a content page even through JavaScript. Since it is just a server-side code block, you can use the same at the code-behind.

Kind regards,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
ADMIN-CV
Top achievements
Rank 1
answered on 04 Oct 2009, 04:57 AM
use this:

 

 

 

 

CType(Master.FindControl("RadAjaxManager1"), Telerik.Web.UI.RadAjaxManager).FocusControl(Me.TextBox)  

 

 

 

 

 

 


 

 

 

Tags
Ajax
Asked by
NS
Top achievements
Rank 1
Answers by
Vlad
Telerik team
NS
Top achievements
Rank 1
Steve
Telerik team
Konstantin Petkov
Telerik team
ADMIN-CV
Top achievements
Rank 1
Share this question
or