Click here to Skip to main content
15,917,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,
I have bind one Gridview Using datatable that is stored in session...Now i added one button(for delete) in grid view using Tempalte i want to do delete Operation on current Row and aftervdeletion I want to bind gridview again...

Important Note Here am using Templare field for button...

here you will get required info.
Share this answer
you can try this way

                       <asp:Button ID="btnDelete" runat="server" Text="Delete" CommandName="Delete"/>

protected void grvTest_RowCommand(object sender, GridViewCommandEventArgs e)
if (e.CommandName == "Delete")
GridViewRow row = (GridViewRow)((Button)e.CommandSource).NamingContainer;

DataTable dt = (DataTable)Session["CurrentTable"];

grvTest.DataSource = dt;
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