Win form GridView problem with the row being displayed

Jayesh Acharya
Jayesh Acharya used Ask the Experts™
on
Currently I populate my grid a number of rows, once the number of rows is larger then the visable screen size, a scroll bar pops up and allows the user to scroll to the bottom.

I want to be able to always display the data from the last row in the visable part of the screen, and allow the user to scroll up if they want. But the focus of the cursor needs to return to in the input text box.

The application is used for order entry people so key strokes are important and where the cursor lands is also important. The want to make sure the grid populates from the top down, but to always show the bottom row on the visiable part of the grid ...

not sure how to do this last part
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
AndyAinscowFreelance programmer / Consultant

Commented:
Two grids - the second has ONLY the final row of the data displayed (user can't scroll it off screen).
Jayesh AcharyaTechnichal Consultant

Author

Commented:
I did propose that we display the final row in a seperate grid line, but the users do not like that, becasue if they do decide to scroll up then they are confused with the information they see.

The grid should ideally push upfor display as you enter information. but when you scroll then that should be the focus.

there must be a setting or something in Gridview to get you to the bottom row.
AndyAinscowFreelance programmer / Consultant

Commented:
Is there a 'Selected' property ?
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

AndyAinscowFreelance programmer / Consultant

Commented:
Is there a 'Selected' property (for a row I mean) ?
set the FirstDisplayedScrollingRowIndex  property to the last row of the table

DataGridView.FirstDisplayedScrollingRowIndex = datatable.Rows.Count - 1;
Jayesh AcharyaTechnichal Consultant

Author

Commented:
fantastic worked exactly as expected ... :)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial