We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,571 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

DataGridView Checkbox

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.

2
Contributors
2
Replies
1 Hour
Discussion Span
10 Months Ago
Last Updated
4
Views
Commando123
Newbie Poster
23 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

place checkbox1.checked to the conditions

gujinni
Junior Poster in Training
67 posts since Jun 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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

Commando123
Newbie Poster
23 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.0603 seconds using 2.65MB