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

Susan Harkins ssharkins at gmail.com
Thu May 21 10:34:38 CDT 2009


Okay, after discussing this a bit with Charlotte, she says the problem is 
the TableAdaptor -- the VB Configuration Wizard uses a TableAdapter to 
populate the control. I'm researching this morning, but I can't seem to find 
anything on editing the TableAdaptor to show only the last few records and 
the edit row, instead of displaying all of the records.

Any help?

Susan  H.

> 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