New to Kendo UI for jQuery? Start a free 30-day trial
Scroll to Selected Row
Updated on Dec 10, 2025
Environment
| Product | Progress® Kendo UI® Grid for jQuery |
| Product Version | Created with the 2017.3.1026 version |
Description
How can I scroll the Kendo UI Grid when a row is selected?
Solution
To programmatically scroll the Grid:
- Handle the
changeevent. - Calculate the distance.
- In an
animateeffect, use thescrollTopof the.k-grid-contentelement.
<div id="grid"></div>
<script>
var dataSource = [];
for (i = 0; i < 100; i++) {
dataSource.push({
name: i,
age: i
});
}
$("#grid").kendoGrid({
columns: [{
field: "name"
},
{
field: "age"
}
],
dataSource: dataSource,
selectable: "row",
scrollable: true,
height: 500,
change: function(e) {
var scrollContentOffset = this.element.find("tbody").offset().top;
var selectContentOffset = this.select().offset().top;
var distance = selectContentOffset - scrollContentOffset;
this.element.find(".k-grid-content").animate({
scrollTop: distance
}, 400);
}
});
var grid = $("#grid").data("kendoGrid");
grid.select("tr:eq(80)");
</script>