I have some logic as follows to try to select the first row of the grid by default after the grid refreshes. However, the grid doesn't seem to finish refreshing until after the selection happens, so I see the first row selected then immediately deselected.
...
.subscribe({
next: alert => {
(this.grid.dataSource as Alert[]).push(alert);
},
complete: () => {
this.grid.refresh();
this.grid.selectRow(0);
}
});
...
Is there a way to subscribe to when the refresh() completes? Or is there another way I might select the first row by default after the grid refreshes?
Thanks.