How To Programatically Scroll To The Last Added Row Of A DataGridView



TODO:

Have you ever wanted to scroll to the last row of a DataGridView?

 

SOLUTION:

//add a row to the grid
dgvMyGrid.Rows.Add(rowdata);

//set the current cell, which will scroll to it
dgvMyGrid.CurrentCell = dgvMyGrid.Rows[dgvMyGrid.RowCount - 1].Cells[0];

 

NOTES:

There are no notes on this topic.



Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading