C# DataGridView绑定数据源的几种常见方式
https://www.cnblogs.com/arxive/p/5943850.html
C#中DataGridView绑定了DataTable后,通过代码修改DataGridView中的数据,总有一行(被修改过并被用户选中的行集合中索引为0的行)不能被UpDate回数据库的问题和解决办法
https://blog.csdn.net/iloli/article/details/9264783
DataGridView与DataTable绑定之后,对DataGridView的修改(选中等)会造成DataTable对应的行/列可能State被置为unchecked
DataGridView编辑后立即更新到数据库的两种方法 编辑单元格
https://blog.csdn.net/sky1466181491/article/details/52399036
单元格内容被修改还需要考虑对回车键是不是响应
单元格内容被更改的事件
private void dataGridView1_CurrentCellDirtyStateChanged(object sender, EventArgs e)
{
if (dataGridView1.IsCurrentCellDirty)
{
dataGridView1.CommitEdit(DataGridViewDataErrorContexts.Commit);
}
}
DataGridView中行列的取法:Rows[数字].Cells[数字] 或者 Rows[数字].Cells[“列名”]
dataGridView1.Rows[e.RowIndex].Cells["DiffNum"].Value = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells["QUANTITY"].Value) - Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells["PassNum"].Value);
c# 对DataTable数据筛选后进行修改操作
记录一次对DataTable中的数据筛选去重后,然后对数据进行修改!
https://www.cnblogs.com/chenyanbin/p/10906310.html