UltraGrid でスクロール位置を保存・復元したい場合は、
- 「UltraGrid – 現在表示されている先頭の行を取得する方法」で先頭行を保存しておき、
- 「UltraGrid – 特定の行までスクロールする方法」で復元します。
private int _firstRowIndexInView = -1; // 保存時 _firstRowIndexInView = ultraGrid1.DisplayLayout.RowScrollRegions[0].VisibleRows[0].Row.Index; // 復元時 if(_firstRowIndexInView >= 0 && _firstRowIndexInView < ultraGrid1.Rows.Count) { ultraGrid1.DisplayLayout.RowScrollRegions[0].FirstRow = ultraGrid1.Rows[_firstRowIndexInView]; }
実行結果
