Hello,
I am trying to implement the Telerik sample Scrolling to the Selected Item. I modifed my ASP.NET page based on this sample. Within the sample, function GridCreated() has the following (second command-line within the function):
var row = this.MasterTableView.SelectedRows[0];
When my ASP.NET page calls function GridCreated(), it fails on the second command-line, and throws the following error:
Microsoft JScript runtime error:
Unable to get value of property 'SelectedRows':
Object is null or undefined.
The RadGrid on my page has AllowPaging="false" and AllowScroll="true". The grid contains 100 rows, but only 20 rows are visible at any given time. You have to scroll up or down to see the other 80 rows. This is exactly how I want the grid to behave. And every row in the grid is assigned a unique number (numbers from 1 to 100). There is a textbox above the grid and when a row number between 1 and 100 is entered into the textbox, the Textbox_TextChanged() programmatically locates the row within the grid, and automatically highlights (selects) that row (that all works fine).
If you are viewing rows 1 - 20 at the time you enter 85 into the textbox, row 85 is programmatically selected, but you have to manually scroll down to see highlighted row 85. This is why I am trying to use the above sample (http://www.telerik.com/help/aspnet/grid/grdscrolltotheselecteditem.html). I do not want to filter the grid. I want the grid to automatically scroll to the row that was programmatically selected. How do I resolve the above error? Do I need to provide more info?
Thank you,
Steven