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

Scroll to item programatically

1 Answer 38 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 25 Jul 2012, 08:22 PM
Hi, I have a RadGrid with scrolling capability. The user can use a search box to enter a reference for a row, and if it's found I need to automatically scroll to that row and select it.

I have the selection working, but it doesn't scroll down automatically to it - is there a way I can do this?

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 26 Jul 2012, 08:08 AM
Hello,

function ClientClicktc() {
                var grid10 = $find("<%= RadGrid10.ClientID %>");
  
                if (grid10) {
                    var MasterTable10 = grid10.get_masterTableView();
                    var Rows10 = MasterTable10.get_dataItems();
                    for (var i = 0; i < Rows10.length; i++) {
                        if (i == 2) { // It will focus /scroll into third row
                                  var row = Rows10[i];
                            row.get_element().cells[0].focus();
                        }
                    }
                }
  
                return false;
            }



Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Chris
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or