Datatable row deletion in Gridview
Posted on 2007-03-22
I have a gridview, which is binded to datatable. I too have a checkbox in each row in gridview. Now, i would like to delete the selected rows by selecting the checkbox in button click event. I have tried as follows.
foreach (GridViewRow row in GridView1.Rows)
bool ischecked = ((CheckBox)row.FindControl("chkDelete")).Checked;
if (ischecked == true)
It worked fine.But, when i add a new row to gridview i see that the deleted rows are getting displayed back again. so, can anybody help me out to delete a row in datatable in gridview?