int index = DataGridView1.CurrentRow.Index; //取得选中行的索引
txt_ProductId.Text = DataGridView1.Rows[index].Cells["Id"].Value; //获取单元格列名为‘Id’的值
时间: 2024-12-29 01:32:14
int index = DataGridView1.CurrentRow.Index; //取得选中行的索引
txt_ProductId.Text = DataGridView1.Rows[index].Cells["Id"].Value; //获取单元格列名为‘Id’的值