|
If it is deleted using Button, here is the code for Button deletion
private void btnDelete_Click (object sender, System.EventArgs e)
{
foreach (DataGridItem dgi in dgShow.Items)
{
CheckBox cb = (CheckBox) dgi.FindControl ("cbSelect");
if (cb.Checked)
{
// The following delete operation is performed
int nID = int.Parse (dgi.Cells [0] .Text);
string strSql = "delete from tbStudentinfo where studentid =" + nID;
ExecuteSql (strSql);
}
}
dgShow.CurrentPageIndex = 0;
BindData ();
} |
|