//获取新增行,遍历GridView查找这条记录 for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = dt.Rows[i]; if (AdviceItemNO == dr["记录编号"].ToString()) { gvAdviceItem.FocusedRowHandle = i; } }