Click here to Skip to main content
15,892,517 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I use datagridview.rows.clear() event to clear the data, during this command it triggers cellleave, cellenter and other events, in this case i receive "Operation did not succeed because he program cannot commit or quit a cell value change" error. How to rectify the error? otherwise i want to temporarily stop all the datagridview events.

What I have tried:

I use the following command datagridview.suspendlayout(), it will not stop the events.
Posted
Comments
CHill60 30-Nov-17 7:52am    
You could have a Boolean property that you set before issuing the .Clear() (or whichever event you like). Check for this being set in any of the events you've coded up and exit if set. Remember to set it back to False though.
kgmmurugesh 4-Dec-17 23:42pm    
I use this logic. Thanks
kgmmurugesh 1-Dec-17 1:21am    
Thanks, Is the any other property is available?
kasbaba 4-Dec-17 8:22am    
Try

datagridview.currentcell = nothing
kasbaba 4-Dec-17 8:23am    
Try
datagridview.currentcell = nothing

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900