If you populate a DataGrid, then click the pager buttons to go to the second page, then update the DataGrid’s RepeatingPanel’s items, the DataGrid goes back to the first page.
The following function allows to update the items in a DataGrid’s RepeatingPanel while preserving the current page, but… using a for
cycle just doesn’t feel right.
Is there a better way?
def update_data_grid(self, repeating_panel, items):
grid = repeating_panel.parent
page = grid.get_page()
repeating_panel.items = items
for _ in range(page):
grid.next_page()