Click here to Skip to main content
15,612,595 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
How to delete a record from datagridview through a button in c#
Updated 24-Aug-11 1:05am
Prerak Patel 24-Aug-11 7:04am    
Not clear. Remove from only gridview or from database?

You can do it on Row Command event

In Gridview make a template field button and give its command name = "del" and commandargument=<%= Eval(DataBinder.ID)%>

In RowCommand Event use this

query="delete from table where id="+e.commandArgument
Share this answer
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