To do this you have to add the GridView_RowDataBound event to the datagrid.
You will have to create a list to store the selected indexes from the checkbox list, let's call it checkedColumnsList [List<int>].
The GridView_RowDataBound must look like the code below
protected void GridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
e.Row.Cells[index].Visible = checkedColumnsList.Contains(index)? true : false;
}
Note that every time user checks or unchecks the visibility you have to Bind the gridview again in order to trigger the GridView_RowDataBound event again and thus change the visibility.