none
How to check if a Datagridview row is displayed RRS feed

  • Question

  • Hi all

    how can I check if a particular datagridview row is actually displayed on the datagrodview, knowing the row index ?

    Thanks for help

    Monday, August 27, 2018 10:35 AM

Answers

  • In this example I use the row index, you could had done some operation, gotten the row index and then use this code.

    If dgv.Rows(_RowIndex).Displayed Then
        MessageBox.Show("Yes")
    End If

    See documentation for Display.

    To scroll

    If Not dgv.Rows(_RowIndex).Displayed Then
        dgv.FirstDisplayedScrollingRowIndex = _RowIndex
    End If


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by Claudio111 Monday, August 27, 2018 11:50 AM
    Monday, August 27, 2018 11:33 AM
    Moderator