如果类似于这样的绑定,
BindingSource bs = new BindingSource();
bs.DataSource = dt;
this.bindingNavigator1.BindingSource = bs;this.dataGridView1.DataSource = bs;
要获取 dt表的行状态。
千万记得在获取和调.dt.AcceptChanges();之前 要
dataGridView1.EndEdit();
bs.EndEdit();
否则会得到null的
DataTable dtModify = dt.GetChanges(DataRowState.Modified);
DataTable dtDelete = dt.GetChanges(DataRowState.Deleted);
今天在这个地方浪费了很多时间,下次不要了。