• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

vb.net DataGridView w/ checkBox selects row

Homerboy

Lifer
I ahve a Datagridview in a VB.net where the 1st column is a check box.
I'd like it so that when the checkbox is checked, he row is selected.
Obviously, if the checkbox is unchecked, then the row should un-select.

I think this can be accomplished witha "CellValueChanged" event (if there is a better one, let me know). But I'm drawing a blank on how to actually highlight the row that the checkbox is located in...

Code:
Public Sub dataGridView1_CellValueChanged(ByVal sender As Object, _
        ByVal e As DataGridViewCellEventArgs) _
        Handles DataGridView1.CellValueChanged

        If DataGridView1.Columns(e.ColumnIndex).Name = "Column1" Then
          
'how do I select the row ?!?!


        End If
    End Sub
 
You'll also want to set DataGridView1.FullRowSelect = true

Or maybe I am thinking ListView, my WinForms is rusty.
 
Back
Top