Skip to content

How do I prevent multiple checked CheckBox Column in DataGrideView control?

Akash

Asked Feb 7, 2008, 8:59 AM EST3 answers
Share
LinkedInX

Guys,

I have a DataGridView with checkbox column in a WINDOWS FORM.  I want user to CHECK only one row/checkbox.  Means if row 2 Checkbox is Checked and user clicks on row 5, I want row 2 Checkbox to Uncheck and row 5 Checkbox to Checked. 

I was able to do this task in CheckedListBox control but I am having a hard time in DataGridView checkbox column.  Please advice me.....thanks.

3 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Please someone answer this post.  I did appreciate.  Thanks
    0
  • 0

    please someone provide me some clue here. Thanks

    0
  • 0

    Private Sub burning_status_view_CellContentClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles burning_status_view.CellContentClick

    sender.endedit()

    Dim status As Boolean = sender.rows(e.RowIndex).cells("select").value 

    For Each row As DataGridViewRow In burning_status_view.Rows

    If row.Cells("select").Value Then  row.Cells("select").Value = False

    Next

    sender.rows(e.RowIndex).cells("select").value = status

    End Sub

    0