Results 1 to 6 of 6

Thread: [RESOLVED] DataGrid usability

Threaded View

  1. #6

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    Re: DataGrid usability

    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:
    1. Imports System.Reflection
    2.  
    3. Class ScrollDataGrid
    4.     Inherits DataGrid
    5.     Dim fi As Reflection.FieldInfo
    6.  
    7.     Public Function ScrollTo(ByVal ivalue As Integer) As Boolean
    8.         Try
    9.             fi = Me.GetType().GetField("m_sbVert", BindingFlags.NonPublic Or BindingFlags.GetField Or BindingFlags.Instance)
    10.             CType(fi.GetValue(Me), VScrollBar).Value = ivalue
    11.             Me.CurrentRowIndex = ivalue
    12.         Catch ex As Exception
    13.             '
    14.         End Try
    15.     End Function
    16.  
    17. End Class
    Attached Images Attached Images  
    Attached Files Attached Files
    Last edited by TDQWERTY; Jun 10th, 2011 at 10:21 AM.
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width