I have a rad window and for that I need to set the default button.Currently, when I hit the Enter key the button inside rad window is working only when my focus is inside the rad window. I need to set the focus to rad window when I open it in server side.
Can anyone help me out on this?
Thanks
1 Answer, 1 is accepted
0
Marin Bratanov
Telerik team
answered on 14 Mar 2012, 04:33 PM
Hi Saniya,
This is the general way defaultButtons work - an input element in the respective panel (or form) must have focus in order for the enter key to trigger the default button action. This is explained in this article from MSDN.
Are you using the ContentTemplate of the RadWindow? If so - you can simply get a reference to the textbox and call its focus() method after showing the RadWindow, e.g.:
In case you are loading an external page you can execute a function in the content page to set the focus. How to do this is explained here. Note that this must be done in the OnClientPageLoad event, as the page will not be loaded before that. For example:
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.