我要做一个入库单..一张入库单里面有会有几种产品入库..数据需要能够通过dataGridView 显示..
每添加一条记录dataGridView不会把上一条记录覆盖.. 记录有从数据库查询出来的也有界面输入的..
谢谢各位了...
很急的问题//..在线等.....
每添加一条记录dataGridView不会把上一条记录覆盖.. 记录有从数据库查询出来的也有界面输入的..
谢谢各位了...
很急的问题//..在线等.....
是不是每次 往里添加行 都会把以前的都重新加了一遍如果这样话 就得先
columns.clear()
rows.clear()
再加载 看看
比如我一次只能输入一种产品 电击确定之后就在dataGridView 显示
A产品 产品名称 产品数量 .....
然后再输入一种产品显示就应该是这样的
A产品 产品名称 产品数量 .....
B产品 产品名称 产品数量 .....
也就是 datagridview1.datasource = datatable
DataGridView.Rows.Add(你要加的记录)
DataRow dr = DataTable.NewRow();dr["ColumnName"] = "Data";DataTable.Rows.Add(dr);GridView.DataSourse = DataTable;
int M_int_CurrentRow = this.dataGridView1.RowCount - 1;
this.dataGridView1.Rows.Add();
this.dataGridView1[0, M_int_CurrentRow].Value = "11";
this.dataGridView1[1, M_int_CurrentRow].Value ="22";
this.dataGridView1[2, M_int_CurrentRow].Value = 100;
this.dataGridView1[3, M_int_CurrentRow].Value = "33";
this.dataGridView1[4, M_int_CurrentRow].Value = "44";