File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
samples/grids/hierarchical-grid/state-persistence-main Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 6464 Moving =" true"
6565 AllowFiltering =" true"
6666 Rendered =" OnGridRendered"
67+ DataChanged =" OnGridDataChanged"
6768 ColumnSelection =" GridSelectionMode.Multiple"
6869 RowSelection =" GridSelectionMode.Multiple" >
6970 <IgbGridState @ref =" gridState" ></IgbGridState >
132133 private IgbGridState gridState ;
133134 private IgbPaginator paginator ;
134135 private bool allOptions = true ;
136+ private bool ready = false ;
135137 private IgbGridStateOptions options = new IgbGridStateOptions ()
136138 {
137139 CellSelection = true ,
257259 }
258260 }
259261
260- public void OnGridRendered ()
262+ public void OnGridDataChanged ()
261263 {
264+ ready = true ;
265+ }
266+
267+ public async void OnGridRendered ()
268+ {
269+ await WaitForGridReadyAsync ();
262270 RestoreGridState ();
263271 }
264272
273+ private async Task WaitForGridReadyAsync ()
274+ {
275+ while (! ready )
276+ {
277+ await Task .Delay (100 ); // wait for update
278+ }
279+ }
280+
265281 async void LeavePage ()
266282 {
267283 SaveGridState ();
You can’t perform that action at this time.
0 commit comments