syntia.wijaya
Member
Hi,
I have a problem with event. I have a DataGridView which one of the column is contains of checkboxes (I use DataGridViewCheckBoxColumn).
When the check box is checked, I want to take the rest of value in the checked row, then put it in the provided text box.
This is my code:
The problem is, it's always one click late Example, when I checked the first row, the value in the text box didnt change. Then I check the second row, the value in the text box changed to the first row value.
Can anyone please help me?
Thank you..
I have a problem with event. I have a DataGridView which one of the column is contains of checkboxes (I use DataGridViewCheckBoxColumn).
When the check box is checked, I want to take the rest of value in the checked row, then put it in the provided text box.
This is my code:
VB.NET:
Private Sub ProjectDataGridView_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles ProjectDataGridView.CellValueChanged
If ProjectDataGridView.CurrentRow.Cells(0).Value Then
ProjectIDTextBox.Text = ProjectDataGridView.CurrentRow.Cells(1).Value
ProjectNameTextBox.Text = ProjectDataGridView.CurrentRow.Cells(2).Value
End If
End Sub
The problem is, it's always one click late Example, when I checked the first row, the value in the text box didnt change. Then I check the second row, the value in the text box changed to the first row value.
Can anyone please help me?
Thank you..