How To Find dataGridView Selected Row index ?
This tutorial i am using dataGridView Key Down event to first Select the row and then press Enter key then
msg box show the selected Row index
private void datagridview1_KeyDown(object sender,KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
MessageBox.Show(dataGridView1.SelectedRows[0].Index.ToString())
}
}
the image is below..
This tutorial i am using dataGridView Key Down event to first Select the row and then press Enter key then
msg box show the selected Row index
private void datagridview1_KeyDown(object sender,KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
MessageBox.Show(dataGridView1.SelectedRows[0].Index.ToString())
}
}
the image is below..
No comments:
Post a Comment