-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
我使用了不同的方法,但它並沒有解決我的問題。