private void button5_Click(object sender, EventArgs e)
{
DataGridView myDGV = new DataGridView();
switch (table)
{
case 1:
if (dataGridView1.CurrentRow.Index < dataGridView1.Rows.Count)
{
dataGridView1.Rows[dataGridView1.CurrentRow.Index + 1].Selected = true;
}
break;
case 2:
if (dataGridView2.CurrentRow.Index < dataGridView2.Rows.Count)
{
dataGridView2.Rows[dataGridView2.CurrentRow.Index + 1].Selected = true;
}
break;
case 3:
if (dataGridView3.CurrentRow.Index < dataGridView3.Rows.Count)
{
dataGridView3.Rows[dataGridView3.CurrentRow.Index + 1].Selected = true;
}
break;
}
}
Перемещение на одну запись вперед в datagridview
Код: