Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid - How to set focus on last row? 1

Status
Not open for further replies.

Autosys

Programmer
Joined
Jun 1, 2004
Messages
90
Location
GB
Hi there,

I'm quite new to VB and would like to know how do I set the cursor to the the last row of data displayed in a DataGrid. Just so that whoever uses it doesn't have to scroll down everytime the grid is populated.

Thanks a lot and apologies for this beginners question ..
S
 
The first two lines here select the last row of a grid and the last line scrolls the grid so that the indicated line is in view:
Code:
  grdDisplay.Row = grdDisplay.Rows - 1
  grdDisplay.RowSel = grdDisplay.Row
  grdDisplay.TopRow = grdDisplay.Row

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top