I have the code to navigate to a specific row based on the primary key index:
public scrollToRow(index: number){
let row = this.grid.getRowByKey(index);
if(index != null || this.grid != null ){
if(row == null){
console.log("Cannot navigate to row that is not in the visible grid viewport.")
}else{
row.selected = true;
let scroll = this.grid.defaultRowHeight * 15;
this.grid.verticalScroll.scrollPosition = scroll;
}
}else{
console.log("Cannot navigate to row that does not exist. Record: " + index + " not found.");
}
}
This only works when there is no pagination on the grid. I am looking for a way to navigate to a specific row when pagination is in play.
If I cannot find a simple method for doing it, my thoughts are to determine the grid sort, and mathematically determine which page a record is on, then go to that page and execute the above code. Problems include how to determine per page value and specific sort details to make that math work. Of course, any help would be appreciated.
Thanks, Ted