Scroll Bar should move down automatically

I

Irfan

hi,
In the datagridview, is it possible that when a datagridview loads it
scrolls down automatically to show the last rows?

I have a datagridview, in which the user has to modify one the columns of
the LAST row every time it loads, so he has to always
scroll down, which is a bit of pain.

Is there any event that i can catch.

TIA
Irfan
 
J

John Timney \(MVP\)

Something like

dataGrid1.Select(dataSet1.Tables[0].Rows.Count);
dataGrid1.CurrentRowIndex = dataSet1.Tables[0].Rows.Count;
dataGrid1.Focus();

should probably move focus to the last row of the grid

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
 
I

Irfan

thanks
It was similar to that.

Datagridview1.FirstDisplayedScrollingRowIndex = dataGridview1.rows.count-1


Irfan






John Timney (MVP) said:
Something like

dataGrid1.Select(dataSet1.Tables[0].Rows.Count);
dataGrid1.CurrentRowIndex = dataSet1.Tables[0].Rows.Count;
dataGrid1.Focus();

should probably move focus to the last row of the grid

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com


Irfan said:
hi,
In the datagridview, is it possible that when a datagridview loads it
scrolls down automatically to show the last rows?

I have a datagridview, in which the user has to modify one the columns of
the LAST row every time it loads, so he has to always
scroll down, which is a bit of pain.

Is there any event that i can catch.

TIA
Irfan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top