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

Problem in Grid Row Focus.

4 Answers 140 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Raja
Top achievements
Rank 1
Raja asked on 02 Dec 2011, 01:20 PM
Hi Team,
             I am facing one problem when i focused rad grid first row  keyboard navigation after grid has binded.Actually I have set the focus of radgrid first row after radgrid has been  binded.I called one client side events(GridCreated) in rad grid  for first row focus.I used following code for set the  row focus.


function RadGrid1Created(sender, args) {




       
        var grid = $find("<%=RadGrid1.ClientID %>");
        var MasterTable = grid.get_masterTableView();
        var data = sender.get_masterTableView().get_dataItems();


        if (data != '') {
            


            var gridview = $find('<%=RadGrid1.ClientID %>');            //                    
            gridview.get_masterTableView().get_dataItems()[0].get_element().cells[1].focus();
            sender.set_activeRow(sender.get_masterTableView().get_dataItems()[0].get_element());
        }




    }

when i pressed keyboard up and down arrow  after grid binded ,page is scorolling,Actually grid keyboard navigation should work.But it is not working.I think it lost focus.But this sample worked perfectly in ie9.But it is not worked in ie8,firefox and chrome...Please give the solution for this...I have attached my sample project.

4 Answers, 1 is accepted

Sort by
0
Galin
Telerik team
answered on 07 Dec 2011, 01:32 PM
Hi Raja,

You can focus the RadGrid by using the focus() method of its DOM element.
Here is the edited function:
function RadGrid1Created(sender, args)
{
    var grid = sender;
    var MasterTable = grid.get_masterTableView();
    var data = sender.get_masterTableView().get_dataItems();
    if(data != '')
    {
        sender.set_activeRow(sender.get_masterTableView().get_dataItems()[0].get_element());
        sender.get_element().focus()
    }
}

I hope it helps.

Kind regards,
Galin
the Telerik team
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
0
Raja
Top achievements
Rank 1
answered on 07 Dec 2011, 02:08 PM
Hi Galin ,
                   Your code working fine in chrome ,firefox and ie9 browser.But it is not working in ie8 and ie7.How to fix that issue in ie7 and ie8...
0
Galin
Telerik team
answered on 08 Dec 2011, 05:48 PM
Hello Raja,

Could you give us more information about your issue? On my side this function works as is expected in every browser.

Regards,
Galin
the Telerik team
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
0
Raja
Top achievements
Rank 1
answered on 13 Dec 2011, 10:50 AM
Hi Galin,
                Please give your email id .i will send my sample project there.Here i can't attach my sample project.I need your help.

Tags
Grid
Asked by
Raja
Top achievements
Rank 1
Answers by
Galin
Telerik team
Raja
Top achievements
Rank 1
Share this question
or