/// <summary>
/// 删除后定位到某一行
/// </summary>
/// <param name="aCode"></param>
/// <returns></returns>
public int LocateRow(string aCode)
{
var list = bindingSource1.DataSource as List<GetNewDateDTO>;
var index = list.IndexOf(list.FirstOrDefault(a => a.Code == aCode));
gridView1.FocusedRowHandle = gridView1.GetRowHandle(index);
gridView1.MakeRowVisible(gridView1.FocusedRowHandle);
return 0;
}
引用该方法即可