DataGridView Unhighlight active cell

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • poops2468
    New Member
    • Apr 2007
    • 7

    DataGridView Unhighlight active cell

    I have a very large DataGridView. When the user is done entering data, they click a button to perform calculations. The last cell the user entered data on remains highlighted (blue in my case). This ruins the other highlighting scheme I added to the calculations. How can I remove this highlight from the grid? Setting focus elsewhere doesn't help.

    Thanks
  • bertino12
    New Member
    • Apr 2008
    • 1

    #2
    Originally posted by poops2468
    I have a very large DataGridView. When the user is done entering data, they click a button to perform calculations. The last cell the user entered data on remains highlighted (blue in my case). This ruins the other highlighting scheme I added to the calculations. How can I remove this highlight from the grid? Setting focus elsewhere doesn't help.

    Thanks
    6 months too late! but, maybe it will help someone in the future.

    Assuming 1 row only.
    For Each dgvCell In Me.Datagridview .Rows(0).Cells
    If dgvCell.Selecte d = True Then
    dgvCell.Selecte d = False
    End If
    Next

    Comment

    Working...