following is the code how to do that
private void DataGridView1_SelectionChanged(object sender, EventArgs e)
{
if (dataGridView1.SelectedRows.Count == 1)
{
txtName.Text = dataGridView1.Rows[DataGridView1.SelectedRows[0].Index].Cells["Name"].Value.ToString();
}
}
private void DataGridView1_SelectionChanged(object sender, EventArgs e)
{
if (dataGridView1.SelectedRows.Count == 1)
{
txtName.Text = dataGridView1.Rows[DataGridView1.SelectedRows[0].Index].Cells["Name"].Value.ToString();
}
}
Comments
Post a Comment