Click here to Skip to main content
15,916,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi to all

in my windows application that i am using the datagrid view in that i had column with check box, my requirement is that when i checked and click a button then that complete row should be delete ,
plz provide an idea and explain how to do this
Posted

DataGridView has a CheckBox column. Use that. In the button click event handler, loop through the rows to find the checked ones and delete.

There quite a few other ways too to find and keep track of the checked rows.
 
Share this answer
 
dear
On button click event traverse row in which checkbox is checked and delete that row ( e.g grdDetails.Rows.RemoveAt(intRowCount) or if you are using foreach loop use grdDetails.Rows.Remove(grdRow)).

Apart from this if there is two way binding if you delete the row from the datasource then automatically that row from grid will be deleted.

Hope this will work ...If not give me your email Id,I will send you an example. :-O

Regards
Manuj Sharma
 
Share this answer
 

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