Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27350

DataGridView BackColor won't reset?

$
0
0
I have a datagridview in which the user can select multiple rows. When they do this, the row's background color changes. That works fine, however, I have a button on my form that when clicked, should reset the DGV to it's original color but it's not working. Here is my code!

Code:

    Private Sub btnClearSelections_Click(sender As Object, e As EventArgs) Handles btnClearSelections.Click
            For Each row As DataGridViewRow In dgv2.SelectedRows
                row.DefaultCellStyle.BackColor = Color.White
            Next
    End Sub

What am I missing?

Thanks,

Viewing all articles
Browse latest Browse all 27350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>