删除行代码:
if (this.dataGridView1.CurrentRow != null)
{
if (dataGridView1.NewRowIndex != -1)
{
GrdData.Rows[dataGridView1.NewRowIndex-1].Delete();
GrdData.AcceptChanges();
this.dataGridView1.DataSource = GrdData;
}
}
用了 GrdData.AcceptChanges();为什么计算行的时候行不变??