1. Take one column status in your table and set its value as 0
2. Bind your gridview with this query:
string q = "select * from table1 where status=0";
3. Take checkbox inside the grid
<asp:CheckBox ID="CheckBox1" runat="server" />
and a delete button
protected void CheckBox2_CheckedChanged(object sender, EventArgs e)
{
CheckBox chk1 = (CheckBox)GridView1.HeaderRow.FindControl("CheckBox2");
foreach (GridViewRow r in GridView1.Rows)
{
/* search id in itemtemplate */
CheckBox chkin = (CheckBox)r.FindControl("CheckBox1");
if (chkin.Checked)
{
//getting datakey/primary key value
string id = GridView1.DataKeys[r.RowIndex].Value.ToString();
//fire update query
string q = "Update table1 set status=1 where id=" + id;
//rebind the griview here. call the method where you are binding gridview
}
}
}
\