-2
private void btnpass_Click(object sender, EventArgs e)
{
Inventory coo = new Inventory(
dataGridView1.SelectedRows[0].Cells[0].Value.ToString(),
dataGridView1.SelectedRows[0].Cells[1].Value.ToString(),
dataGridView1.SelectedRows[0].Cells[2].Value.ToString(),
dataGridView1.SelectedRows[0].Cells[3].Value.ToString(),
dataGridView1.SelectedRows[0].Cells[4].Value.ToString(),
dataGridView1.SelectedRows[0].Cells[5].Value.ToString(),
dataGridView1.SelectedRows[0].Cells[6].Value.ToString());
coo.Show();
}
上我试图所选行GridView
到另一个GridView
通过另一种形式的上,但我得到一个错误:通行证所选行一个gridview的另一个gridview的另一种形式
Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
我使用了不同的方法,但它并没有解决我的问题。