private void dataGridView1_CellMouseMove(object sender, DataGridViewCellMouseEventArgs e)
{
if (e.RowIndex >= 0)
{
if (!((DataGridViewRow)(dataGridView1.Rows[e.RowIndex])).Selected)
{
dataGridView1.ClearSelection();
((DataGridViewRow)dataGridView1.Rows[e.RowIndex]).Selected = true;
if (dataGridView1.SelectedRows.Count > 0)
{
DataGridViewRow row = (DataGridViewRow)dataGridView1.Rows[e.RowIndex];
TextBox1.Text = e.RowIndex.ToString();
// return row index of dataGridView On CellMouseMove Event and Display RowIndex in TextBox1. }
}
}
}
No comments:
Post a Comment