Finally managed how to programatically scroll a datagrid with the help of several websites code samples.
Here's a test implementation of the code below and a custom up/down column:
VB Code:
Imports System.Reflection Class ScrollDataGrid Inherits DataGrid Dim fi As Reflection.FieldInfo Public Function ScrollTo(ByVal ivalue As Integer) As Boolean Try fi = Me.GetType().GetField("m_sbVert", BindingFlags.NonPublic Or BindingFlags.GetField Or BindingFlags.Instance) CType(fi.GetValue(Me), VScrollBar).Value = ivalue Me.CurrentRowIndex = ivalue Catch ex As Exception ' End Try End Function End Class




and rating it.
Reply With Quote