Click here to Skip to main content
15,069,020 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to add a check box in a grid view and then delete the checked items only through a delete button in the grid view itself
Posted

To add the Control :
CheckBox cb=new CheckBox();
cb.ID="myCb";
gv.Rows[0].Cells[0].Controls.add(cb);

to remove the checkbox:
CheckBox cb=new CheckBox();
cb=gv.Rows[0].Cells[0].FindControl("myCon") as CheckBox;
gv.Rows[0].Cells[0].Controls.Remove((Control)cb);
   
v2

Do you mean in ASP.NET or winforms ? Either way, there's tons of examples on the web, what have you tried ?

   
   

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