Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

catch the check change event in the datagridview checkbox column

$
0
0
hi,
the first visible column of my datagridview is a checkbox . the gridview has 3 rows, and i want something to hapen when the user checks and unchecks the checkbox of the second row.

i found out the proper method to do that, but i get an error like "Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index"

here is my code:

  Private Sub ApMICDestinationTypesDataGridView_CellValueChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles ApMICDestinationTypesDataGridView.CellValueChanged
        Dim destination_abroad As Boolean = ApMICDestinationTypesDataGridView.Rows(1).Cells(2).Value

        If destination_abroad = True Then

            GroupTypeIDLabel.Visible = True
            GroupTypeIDComboBox.Visible = True
else 
            GroupTypeIDLabel.Visible = False
            GroupTypeIDComboBox.Visible = False

        End If
    End Sub




thanks a lot

Viewing all articles
Browse latest Browse all 51036

Trending Articles



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