Use DataGridViewRow's *Displayed* property to test whether that row has been
displayed on screen or not. And then use DataGridView's *
FirstDisplayedScrollingRowIndex* property to make this row visible.

E.g.
If Not Me.DataGridView1.SelectedRow.Displayed Then
    Me.DataGridView1.FirstDisplayedScrollingRowIndex =
Me.DataGridView1.SelectedRow.Index
End If

On Thu, Jan 13, 2011 at 4:29 AM, Markei54545 <[email protected]>wrote:

> Hi all,
>
> I have a datagridview. I manually populate it.
>
> I can programmatically set it to go to a certain line on the grid, but
> sometimes this is off the bottom of the screen and I have to scroll
> down to find the selected row.
>
> Any ideas on how to get it to show the selected row without scrolling.
>
> Cheers
>
> Mark
>
>

Reply via email to