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

[Solved] DefaultFocus for EditMode="PopUp"

1 Answer 63 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Eric Krauska
Top achievements
Rank 1
Eric Krauska asked on 04 Aug 2009, 03:01 PM
Is there a way to set the DefaultFocus (or similar) for the first textbox when popping up into Edit Mode?  I have a 3 level deep master detail grid and for each level of detail when editing I would like to specify the focus or cursor to be in the first text box. Any help is appreciated

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 07 Aug 2009, 03:56 PM
Hello Eric,

I recommend you use the following approach:
<script type="text/javascript"
    function popupShowing(sender, args) 
    { 
        var inputs = args.get_popUp().getElementsByTagName("input"); 
        setTimeout(function() { inputs[0].focus(); }, 1); 
    } 
</script> 

<ClientSettings> 
   <ClientEvents OnPopUpShowing="popupShowing" /> 
   ... 
</ClientSettings> 

I hope this helps.

Regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Eric Krauska
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or