Dev XtraGrid 刷新后定位上次选中行并且滚动条不变
·
加view的TopRowChanged事件
private void gdvAllScheduling_TopRowChanged(object sender, EventArgs e)
{
topIndex = gdvAllScheduling.TopRowIndex;
}
int topIndex = -1;
public void FoucedRefreshData()
{
var _Column = this.gdvAllScheduling.FocusedColumn;
var _RowIndex = this.gdvAllScheduling.FocusedRowHandle;
this.RefreshData();
this.gdvAllScheduling.TopRowChanged -= new
System.EventHandler(this.gdvAllScheduling_TopRowChanged);
this.gdvAllScheduling.FocusedColumn = _Column;
this.gdvAllScheduling.FocusedRowHandle = _RowIndex;
gdvAllScheduling.TopRowIndex = topIndex;//设置垂直滚动条位置
this.gdvAllScheduling.TopRowChanged += new
System.EventHandler(this.gdvAllScheduling_TopRowChanged);
}
更多推荐
所有评论(0)