hello guys,

can anyone help me with this plz??
i have a datagrid view that is bound to a database, and the is a checkbox that is also bound to a flg in this database.

i want to put some conditions on checking or unchecking this flg.

what event do u suggest to do this condition on? and how can i recheck or uncheck the check box in the datagridview after the conditions get uplied

i have tried this code but i still have a problem with checking the checkbox!!

Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles TransactionsDataGridView.CellContentClick
If Me.TransactionsDataGridView.Columns(e.ColumnIndex).Name = "DataGridViewCheckBoxColumn1" Then
  If TransactionsDataGridView.CurrentRow.Cells(7).Value = True Then
      MsgBox("Deleted transactions can not be undeleted")
  Else
     Dim result As DialogResult = MessageBox.Show("Are you shure you want to delete this transaction?", "Mobile Phone Solution", MessageBoxButtons.YesNo)
      If result = Windows.Forms.DialogResult.Yes Then
      End If
   End If
  End If
End Sub

thank you for the help.

place checkbox1.checked to the conditions

but the checkbox is a coulmn in datagried view not an ordinary checkbox!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.