Rectangle 27 0

GridView Control events are stored in viewstate and they can get messed up very easily. Here removing a cell causing to bind different event to link button. Although after postback __EVENTTARGET is LinkButton, wrong method is called and wrong control, event arguments are passed.

I would suggest to hide the cell rather than removing it:

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.Footer)
    {
        e.Row.Cells[1].ColumnSpan = GridView1.Columns.Count - 1;
        e.Row.Cells[0].Visible = false;

        ((CheckBox)e.Row.FindControl("CheckBox1")).Checked = true;
    }
}

asp.net - CheckBox in GridView firing CheckedChanged event at wrong ti...

asp.net gridview event-handling