VB.Net DataViewGrid Problem

I am iterating through a grid to find out which rows have a checbox clicked (checkboxes are in column 1). They are all defaulted to clicked initially and I can unclick as many as i like. So for example if i unclick 2 out of eleven rows and hit the save button ,I am told that 10 rows are to be updated instead of 9. The last row unclicked is not recognised. Is there any way to update all the grid changes before hitting the save button.? Hope that makes sense.
Thanks,
M.
Marias099Asked:
Who is Participating?
 
appariConnect With a Mentor Commented:
try calling datagridview.endedit method before starting your save process.
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
Wath does your save button (code)?
0
 
Marias099Author Commented:
The endedit method worked fine. Thanks.
0
 
convertixCommented:
Dim ctlCheckbox as Control

For Each GVR as GridViewRow In GV.Rows
  ctlCheckbox = GVR.Cells(1).Controls(1)
  If TryCast(ctlCheckbox,CheckBox).Checked Then
     'Update
  End If
Next
   
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
>> The endedit method worked fine. Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.