0
我正在尋找將datagridview值傳遞給另一個表單進行編輯。我可以找到很多代碼背後的例子,但我似乎無法找到一個將代碼從代碼背後取出的例子。將datagridview值傳遞給另一個表單
我的示例代碼
ProductView productView = new ProductView();
productview.txtbox1.Text = this.dataGridView1.CurrentRow.Cells[1].Value.ToString();
productview.txtbox2.Text = this.dataGridView1.CurrentRow.Cells[2].Value.ToString();
productview.txtbox3.Text = this.dataGridView1.CurrentRow.Cells[3].Value.ToString();
productview.txtbox4.Text = this.dataGridView1.CurrentRow.Cells[0].Value.ToString();
productview.ShowDialog();
這東西是允許把後面的代碼? 我嘗試儘可能少的代碼,只有必要的東西。
你的意思是「儘量少放在後面的代碼」?你會在哪裏放置你的代碼? –
我嘗試儘可能多地放在我的主持人/控制器/ ...但這種情況我不知道該怎麼做 – suspected