说明:
(1)dgvGoods 是DataGridView名
(2)index 是最大行索引
DataGridViewRow row = new DataGridViewRow();
int index = dgvGoods.Rows.Add(row);
dgvGoods.Rows[index].Cells["列名1"].Value = 值1;
dgvGoods.Rows[index].Cells["列名2"].Value = 值2;
、、、
时间: 2024-10-29 00:04:47