Bookmark and Share BitCoin Donate: 13t8gAWVpHP2ddxMp88d1NFpZjnFJC6UwK
This assumes you use template controls with ids:
Example aspx:
            <asp:GridView id="catalogView" runat="server" AutoGenerateColumns="false">
                <Columns>
                    <asp:TemplateField HeaderText="Item">
                        <ItemTemplate>
                            <asp:Label ID="itemDescriptionField" runat="server" Text='' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Comments">
                        <ItemTemplate>
                            <asp:Label ID="commentsField" runat="server" Text='' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Model">
                        <ItemTemplate>
                            <asp:Label ID="modelField" runat="server" Text='' />
                        </ItemTemplate>
                    </asp:TemplateField>
		      </Columns>
		</asp:GridView>

Code behind:

        private void setGridControlVisibility(string ControlID, bool Visible)
        {
            GridViewRow headerRow = catalogView.HeaderRow;
            
            foreach (GridViewRow row in catalogView.Rows)
            {
                Control c = row.FindControl(ControlID);                
                DataControlFieldCell cParent = (DataControlFieldCell)c.Parent;
                int ColumnIndex = catalogView.Columns.IndexOf(cParent.ContainingField);
                
                if (c != null)
                {
                    if (Visible)
                    {
                        c.Visible = true;
                        c.Parent.Visible = true;
                        cParent.TemplateControl.Visible = true;
                        headerRow.Cells[ColumnIndex].Visible = true;
                    }
                    else
                    {
                        c.Visible = false;
                        c.Parent.Visible = false;
                        cParent.TemplateControl.Visible = false;
                        headerRow.Cells[ColumnIndex].Visible = false;
                    }
                }
            }
        }