Angular datagrid set initial page to selected row

I have a datagrid with pagesize set to 10 and the value property set to ${selection}, using code similar to the post from Angular Datagrid dialog navigation. This code works great to select the row just edited. However, if the row edited was not on the 1st page, the selected row is not seen until paging to the grid page the selection is found on. For example, the datagrid contains 40 rows, which spans 4 pages. If a row is selected on the third page, the edit dialog is opened. Upon closing the edit dialog box, the datagrid data is rebuilt to show any changes, then the value property of the datagrid is set to the object containing the row just edited. When the datagrid is redisplayed, it is showing page 1 of 4. Clicking to page 3, you can see the row just edited is the row selected. I would like to have the datagrid positioned to page 3 (of 4) when it is redisplayed. Is it possible to set the page shown initially to the page that contains the selected row?

Hi @afeldmann,

Unlike our Blazor DataGrid there is no such method exposed for Radzen Angular DataGrid. I’ll check if the wrapped PrimeNG DataTable supports this and I’ll expose new method if possible.

It was easier that I expected. You can execute the following code to go to the second page for example:

this.grid0.onPage({first: this.grid0.pageSize * 1, rows: this.grid0.pageSize})


A new goToPage(index:number) method is added in our latest release:

Thank-you! Both methods that you mentioned work on the initial load of the grid. I've tested by manually setting (hard coding) the value of the index before executing the method and the correct page of the grid is shown, However, any subsequent reload of the grid, where the goToPage method is executed again, always displays the first page of the grid, regardless of the value of the index that was passed to the method. I have the same issue with using the onPage method, in that the first execution of the method works, but the subsequent executions display the first page of the grid. Do you have a suggestion for getting the second and subsequent executions of those methods to work?