datagirdview新增行出现的问题
DataRow newrow = Ds.Tables[0].NewRow(); //newrow.BeginEdit();
//newrow["Materialsupid"] = txt_MaterialCode.Text;
newrow["MaterialCode"] = txt_MaterialCode.Text;
//newrow.EndEdit();
Ds.Tables[0].Rows.Add(newrow);
BindingSource bindingSource = new BindingSource();
bindingSource.DataSource = Ds.Tables[0].DefaultView;
dataGridView1.DataSource = bindingSource;
bindingNavigator1.BindingSource = bindingSource;
Materialsupid同MaterialCode字段为主键,即一个物料编码对应多个供应商.Materialsupid供应商需要开放给用户输入,//newrow["Materialsupid"] = "测试";所以这个不开放出来让用户输入,可是用户输入了还是报为空值,
发现新增行后要光标移动到其它行后就可以保存呢.怎么回事.
如图所示" border="0" />