有2个DataGridview 和Cellendedit事件在第一个 我如何才能使这个事件在第二个DataGridview中添加行?
DataGridViewTextBoxCell textBoxCell = new DataGridViewTextBoxCell();
textBoxCell.Value = itemDetails.First().UnitNameArabic;
dataGridView1.Rows[i].Cells[4].Value = itemDetails.First().SalePrice;
dataGridView1.Rows[i].Cells[1].Value = itemDetails.First().NameArabic;
dataGridView1.Rows[i].Cells[0].Value = itemDetails.First().Number;
dataGridView1.Rows[i].Cells[2] = textBoxCell;
DataGridViewRow row = new DataGridViewRow();
row.Cells[0].Value = itemDetails.First().NameArabic;
dataGridView2.Rows.Add(row);
dataGridView2.Refresh();
不使用第二个GridView
答案 0 :(得分:0)
DataGridViewRow row2 = (DataGridViewRow)dataGridView2.Rows[i].Clone();