超出索引范围了 加上范围if (e.RowType == DataControlRowType.DataRow){ this.GridView1.DataKeys[e.Row.RowIndex].Values;}保证只有当该行为数据行才执行