grid.scrollTo ( $row )

3 posts, 0 answers
  1. Tim R
    Tim R avatar
    132 posts
    Member since:
    Feb 2006

    Posted 21 Feb 2013 Link to this post

              kendoGrid.scrollTo( $row );

    What is the most reliable way, in the opinion of the kendo staff?

    This would be a good built-in method to add to the API.

    EDIT: Got it!

            var _offset = $(myRow).offset();
            var _topoffset =;
            $("#grid div.k-grid-content").scrollTop(_topoffset);


  2. John
    John avatar
    12 posts
    Member since:
    Jul 2011

    Posted 07 May 2014 in reply to Tim R Link to this post

    I've discovered that if the grid isn't on top then things go bad.  Everything I've seen says to use offset but I switched to position and it works for grids that are down lower on the page

    If anyone's having issues with offset being 'off' try this (dataBound event) code which scolls a row into view and selects it:

    var grid = this;
    var row = grid.table.find('div[data-isselected="true"]').closest("tr");  // custom data attribute I put on one of the columns
    if (row.length != 0) {
        $("#gridProjects div.k-grid-content").scrollTop($(row).position().top); //scroll the content
  3. Curt Rabon
    Curt Rabon avatar
    69 posts
    Member since:
    Dec 2008

    Posted 20 Mar 2015 in reply to John Link to this post

    If you have a reference to the grid object, then 1 small thing I discovered (using Firefox web console), is that in addition to using gridObject.tbody, you can also use gridObject.content  ...which is the <div class="k-grid-content".

    So, you can do: myGridObj.content.scrollTop()
Back to Top