Hi,
I have a read-only grid where I am using .READ method to fetch data from the database and show it on screen. The grid has a scrollbar. I want the grid to auto scroll to the end so that the last record is visible on screen.
Please help.
Regards,
Sanjay
I have a read-only grid where I am using .READ method to fetch data from the database and show it on screen. The grid has a scrollbar. I want the grid to auto scroll to the end so that the last record is visible on screen.
Please help.
Regards,
Sanjay
5 Answers, 1 is accepted
0
Accepted
Matt Barker
Top achievements
Rank 1
answered on 26 Mar 2015, 02:05 PM
Something like this?
var grids = document.getElementsByClassName('k-grid-content'), index = 0, grid;for (; index < grids.length; index++) { grid = grids[index]; grid.scrollTop = grid.scrollHeight;}0
Sanjay
Top achievements
Rank 1
answered on 27 Mar 2015, 03:42 AM
Something strange is happening. The value for grid.scrollTop remain 0 even though grid.scrollHeight is not 0.
0
Matt Barker
Top achievements
Rank 1
answered on 27 Mar 2015, 09:58 AM
Then I think that you must have a code error somewhere. It works for me on the latest version of Chrome on Windows XP:
https://jsfiddle.net/56omxkv1/
https://jsfiddle.net/56omxkv1/
0
Accepted
Hello Sanjay,
The Matthew's approach is valid and works as expected on our side as well. Here you can find another similar example of scrolling the grid content to given row.
Regards,
Vladimir Iliev
Telerik
The Matthew's approach is valid and works as expected on our side as well. Here you can find another similar example of scrolling the grid content to given row.
Regards,
Vladimir Iliev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Sanjay
Top achievements
Rank 1
answered on 30 Mar 2015, 09:28 AM
Dear Vladimir/Matt,
Sorry it was error in my code. Both the approach works.
Thanks
Regards,
Sanjay
Sorry it was error in my code. Both the approach works.
Thanks
Regards,
Sanjay