Click here to Skip to main content
15,898,373 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to release binding in DataGridView c# window application click on button.
when i click on the button again it give error:- This causes two bindings in the collection to bind to the same property.
Parameter name: binding
Posted

1 solution

There are two ways you could do this:

1) You can set the DataSource property of the DataGridView to null

2) You can clear the DataBindings on the DataGridView as follows:
dataGridView1.DataBindings.Clear();


Hope it helps :-)
 
Share this answer
 
v2
Comments
thatraja 29-May-11 6:19am    
Good answer
Kim Togo 29-May-11 6:43am    
Thanks

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