• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1544
  • Last Modified:

Datagridview, ensure last row visible

Hi Experts,

How to make the newly added row in a datagridview visible.
I have tried:
datagridview1.Rows(datagridview1.Rows.Count - 1).Selected = True.
But the last row is not in view once the vertical scrollbar appear.

(In vb6, there is a function called EnsureVisible for ListView:
ListView1.ListItems(ListView1.ListItems.Count).EnsureVisible)
0
LoGa1234567890
Asked:
LoGa1234567890
1 Solution
 
CodeCruiserCommented:
Datagridview has the firstdisplayedscrollingrowindex property which you can set to force it to scroll down.


http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.firstdisplayedscrollingrowindex.aspx
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now