sanjay  gupta

sanjay gupta

  • 0
  • 248
  • 0

to delete a row in gridview

Oct 10 2009 4:49 AM

i want to delete a row with the help of checkbox using gridview. But i don't want to delete from database.
as we do in e-shopping after selecting the product we want to delete a specific record from selecting list.
But it should not be deleted from database.
 for (int i = 0; i < GridView.Rows.Count; i++)
            CheckBox cbb = (CheckBox)GridView.Rows[i].FindControl("CheckBox1");
            if (cbb.Checked == true)
             int id = Convert.ToInt32(GridView.Rows[i].Cells[1].Text);

it gives the id of that row.
but how it is deleted from the gridview

please help me

Answers (2)