Click here to Skip to main content
15,914,416 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What are the approaches to delete rows from gridview (with delete comand button)without deleting the data from database? please provide some examples.. :(
Posted
Comments
[no name] 6-May-14 15:16pm    
Examples for what? One does not have to have anything to do with the other.

One has nothing to do with the other. Unless you specifically tell some method to update the database with the changes, you could delete every single record in the DataGridView and nothing will happen to the database.
 
Share this answer
 
hiiii,

try this one

C#
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
    dt.Rows.RemoveAt(e.RowIndex);
    GridView1.DataSource = dt;
    GridView1.DataBind();
}
 
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