UltraGrid でスクロール位置を保存・復元したい場合は、

  1. UltraGrid – 現在表示されている先頭の行を取得する方法」で先頭行を保存しておき、
  2. 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];
}

実行結果

 

 

Tagged:

製品について

Ultimate UI for Windows Forms