foreach (GridViewRow row in GdState.Rows)
{
GdState.SelectedIndex = row.RowIndex;
CheckBox Chkbxstate = row.FindControl("chkchild") as CheckBox;
if (Chkbxstate != null && Chkbxstate.Checked)
{
to.StateId1 = Convert.ToInt32(row.SelectedValue);
counter += cm.DeleteState(to);
}
GdState.SelectedIndex = -1;
}