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

[Solved] focus on radgrid

1 Answer 216 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ayesha
Top achievements
Rank 1
Ayesha asked on 09 Feb 2010, 07:40 PM
Hi,

How do I set focus on my radgrid when my page loads.

I do both Radgrid1.focus() and radgrid1.mastertableview.focus(). but it doesn't set focus on my grid.
I've a tabindex set to 1 for radgrid. But when my page loads , my radgrid is not having focus what should I do? So, when I tab , my focus goes to the IE url /.

Pls show mw with code, how do I set focus on the grid (which has tabindex to 1 and then when I tab on , the tab shoul d moive to other ctrls outside grid.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 10 Feb 2010, 08:06 AM
Hello Ayesha,

Here is the code that I tried in order to focus to the first cell in the grid in the GridCreated event handler. Give a try with this and see whether it suits your scenario.

JavaScript:
 
<script type="text/javascript"
    function GridCreated(sender, args) { 
        //  sender.get_masterTableView().get_dataItems()[0].get_element().cells[0].style.backgroundColor = "green"; 
        sender.get_masterTableView().get_dataItems()[0].get_element().cells[0].focus(); 
    }  
</script> 

Thanks,
Princy.
Tags
Grid
Asked by
Ayesha
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or