Results 1 to 13 of 13

Thread: [RESOLVED] DataGridView CheckBox

Threaded View

  1. #10

    Thread Starter
    Lively Member anamada's Avatar
    Join Date
    Jun 2011
    Location
    Philippines, Makati
    Posts
    107

    Re: DataGridView CheckBox

    Kevin,

    I just did an simple alternate solution and i find it working


    Code:
    Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
            If (DataGridView1.Columns(e.ColumnIndex).Name = "checkboxparent") Then
                If (e.RowIndex >= 0) Then
                    Me.DataGridView1.Rows(e.RowIndex).Cells(1).Value = False
                    For Each row As DataGridViewRow In Me.DataGridView1.Rows
                        If (row.Index <> e.RowIndex) Then
                            row.Cells("checkboxparent").Value = False
                        End If
                    Next
                End If
            Else
                If (e.RowIndex >= 0) Then
                    Me.DataGridView1.Rows(e.RowIndex).Cells(0).Value = False
                End If
            End If
    
        End Sub
    Thanks Dude for giving me new ways and ideas. +1 Rep to you
    Last edited by anamada; Aug 2nd, 2011 at 01:50 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width