[dba-VB] How to limit number of rows in datagridview control

Susan Harkins ssharkins at gmail.com
Wed May 20 13:55:42 CDT 2009


Using VB Express 8, I added the following to a form class with a 
datagridview control, expecting it to limit the number of rows displayed in 
the grid, so that the edit row is immediately visible. It doesn't return an 
error, but it doesn't seem to do anything at all either -- view is the same 
with or without this sub.

Private Sub CustomersDataGridView_RowValidated(ByVal sender As Object, ByVal 
e As System.Windows.Forms.DataGridViewCellEventArgs) Handles 
CustomersDataGridView.RowValidated

CustomersDataGridView.FirstDisplayedScrollingRowIndex = 
CustomersDataGridView.Rows.Count - 5

End Sub

Susan H.




More information about the dba-VB mailing list