チェックボックスがクリックされたかどうかに応じて、行の色を変更しています。チェックボックスをクリックすると、その行は「クリティカル」と見なされるため、赤い色を適用するメソッドを呼び出します。
Private Sub dgvAssemblies_CellContentClick(sender As Object, e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvAssemblies.CellContentClick, dgvExpeditions.CellContentClick, dgvMachines.CellContentClick
Dim s As DataGridView = sender
If s.Columns(e.ColumnIndex).Name = s.Name.Remove(0, 3) & "ColChkCritical" Then
If s.Rows(e.RowIndex).Cells(e.ColumnIndex).Value Then
FormatRowColor(s.Rows(e.RowIndex), "Critical")
End If
End If
End Sub
次のコードは、行と状態をパラメータとして受け取る「FormatRowColor」メソッドを呼び出します。その部分は正しく機能します。問題は、チェックボックスをクリックするとすぐに、行の色が変わらないことです。
何か不足していますか?