Anyway to tell if a datagrid row is visible?

T

Terry Olsen

I need a way to programmatically tell if a row is visible or has scrolled
out of view. Any Ideas? Thanks!
 
K

Ken Tucker [MVP]

Hi,

In form load event save location of first cell in datagrid.

pt = dg.GetCellBounds(0, 0).Location



To get first visible cell and number of visible cells



Dim hti As DataGrid.HitTestInfo = dg.HitTest(pt)

Dim newRow As Integer = hti.Row

Trace.WriteLine(String.Format("First Row {0} Visible rows {1}", hti.Row,
dg.VisibleRowCount))



Ken
 

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