Until release 2008 Q2 , the function <control>.Focus() works well.
With release 2008 Q3, the function <control>.Focus doesn't work, when in page exists RadFormDecorator !!!
I tried removing RadFormDecorator, the Focus works fine.
Add RadFormDecorator, the Focus doesn't work !!!
Thank you.
1 Answer, 1 is accepted
0
Tervel
Telerik team
answered on 28 Nov 2008, 10:58 AM
Hello Marco,
I am not aware of any change that we have introduced to change the behavior of RadFormDecorator with that respect. However, setting a control focus using its .Focus method is different for ASP.NET controls and for Telerik controls. You have not specified which type of control you are trying to set focus to, so I am not able to provide more detailed suggestions here.
Telerik controls set focus in their intialization method - which is the correct way, since in that moment the page initialization is complete. On the other hand, ASP.NET controls's focus is set by outputing some javascript by the MS AJAX framework. Unfortunately the javascript is executed right where it is inserted - and that is - prior to initialization of the ASP.NET AJAX framework.
As a result, focus is set, then MS AJAX controls are intialized - that is, when RadFormDecorator is initialized as well. The decoration process, performed by the decorator, involves changes to the DOM and moving of elements. This causes the focus set to be lost.
The only possible workaround is to execute setting of focus with a slight delay to provide the chance for the form decorator to perform its job. Here is how to do it: