加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);
}