Progamatically Scroll DataGrid Control

Discussion in 'Visual Basic ( VB )' started by ABoy, Apr 17, 2008.

  1. ABoy

    ABoy New Member

    Joined:
    Apr 17, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    HI

    I'm using a Win forms data grid control and want to progamatically select a record in it. I have done it and the problem I have is, to get in to the auto selected row user have to scroll the grid.

    I need to find a method to automatically scroll the grid for the selected record so the user don't have to do any action to get to the position?

    Thanks
     
  2. excavator

    excavator New Member

    Joined:
    Apr 25, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Home Page:
    http://www.hiddenbyte.com
    you can use datagrid.currentcell property
    Code:
    datagrid.CurrentCell = New DataGridCell(r, c)
    where r = index of the selected row and c = index of the column

    hope this help
     
  3. ABoy

    ABoy New Member

    Joined:
    Apr 17, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Cool, that did help thanks Excavator
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice