foreach (DataGridViewRow row in dataGridView1.Rows)
{
row.Cells["OrderInid"].Value = OrderInid.SetTextValue;}
如果OrderInid是隐藏列就不能把新值赋给他,如果不隐藏就可以.因为通过ds.table[0]操作有时麻烦,因为一旦删除某行记录索引变了,所以没用
{
row.Cells["OrderInid"].Value = OrderInid.SetTextValue;}
如果OrderInid是隐藏列就不能把新值赋给他,如果不隐藏就可以.因为通过ds.table[0]操作有时麻烦,因为一旦删除某行记录索引变了,所以没用
{
row.Cells["OrderInid"].Value = OrderInid.SetTextValue;
dataGridView1.EndEdit();
}
还是不行,是不是这样更改没有放到数据集dataset里面去啊,但如果显示这样就没有问题
foreach (DataGridViewRow row in dataGridView1.Rows)
{
row.Cells["OrderInid"].Value = OrderInid.SetTextValue;
row.Cells["Cancel"].Value = checkBox1.Checked ? "1" : "0";
}
dataGridView1.EndEdit();
这样就OK了