No matter what i try it just wont pick the value as 1 = checked.
Is there any other way to pick the checked checkbox value and pas it to function _monitoringcheck
Private Sub dgv2_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgv2.CellContentClick
Dim senderGrid = DirectCast(sender, DataGridView)
Dim _idTabele As Long
If bsDgv3.Position >= 0 And bsDgv3.Position < Dgv3.Rows.Count Then
_idTabele = Me.Dgv3.Rows(bsDgv3.Position).Cells("dgv3_id").Value
End If
If TypeOf senderGrid.Columns(e.ColumnIndex) Is DataGridViewCheckBoxColumn AndAlso e.RowIndex >= 0 AndAlso senderGrid.Columns(e.ColumnIndex).Name = "chkStatus" Then
Dim strValue As Integer
If dgv2.Columns(e.ColumnIndex).Name = "chkStatus" Then
Try
strValue = Me.dgv2.Item(e.ColumnIndex, e.RowIndex).Value
Catch ex As Exception
strValue = 0
End Try
cl._MonitoringCheck(Math.Abs(CInt(strValue)), _idTabele)
End If
End If
End Sub
Even if i include the "dirty check "
Sub dataGridView1_CurrentCellDirtyStateChanged(ByVal sender As Object, ByVal e As EventArgs) Handles Dgv3.CurrentCellDirtyStateChanged
If Dgv3.IsCurrentCellDirty Then
Dgv3.CommitEdit(DataGridViewDataErrorContexts.Commit)
End If
End Sub
Aucun commentaire:
Enregistrer un commentaire