Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9005955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:17:04+00:00 2026-06-16T01:17:04+00:00

I have a standard grid view, which contains a number of bounded fields and

  • 0

I have a standard grid view, which contains a number of bounded fields and template fields, out of these I would like to make 4 columns invisible.

I know the css for this is visibility:hidden; but I do not know how to apply it to just these 4 columns, I have tried using the ControlStyle-CssClass property but it seems to apply the css to the whole table.

Is there a way to apply this css only to these 4 columns, also the plan is after I manage this is to write some Javascript for a button to switch the visibility on and off, so if you could please use some CSS/tags etc which can be easily changed client side it would be a huge plus.

A example:

<asp:GridView ID="gwFoo" runat="server" AutoGenerateColumns="False" DataKeyNames="Id"
                        Width="631px" OnRowDataBound="gwFoo_RowDataBound"
                        CssClass="customerDataTable" AllowSorting="True">
                        <Columns>
                            <asp:BoundField DataField="type" HeaderText="Type" SortExpression="type" />
                            <asp:TemplateField HeaderText="Number" SortExpression="id">
                                <ItemTemplate>
                                    <asp:HyperLink ID="hlNumber" runat="server">[hlNumber]</asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="product" HeaderText="Product" SortExpression="product" />
                            <asp:BoundField DataField="startDate" HeaderText="Start Date" SortExpression="startDate" />
                            <asp:BoundField DataField="endDate" HeaderText="End Date" SortExpression="endDate" />
                            <asp:BoundField DataField="isActive" HeaderText="Is Active ?" SortExpression="isActive" />
                            <asp:BoundField DataField="markedForActivation" HeaderText="Marked for Activation ?" SortExpression="markedForActivation" />
                            <asp:BoundField DataField="status" HeaderText="Status" SortExpression="status" />


                            <asp:TemplateField HeaderText="Parent Order" SortExpression="Foo">
                                <ItemTemplate>
                                    <asp:HyperLink ID="hlFoo" runat="server">[hlFoo]</asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Parent Document" SortExpression="Foo">
                                <ItemTemplate>
                                    <asp:HyperLink ID="hlFoo" runat="server">[hlFoo]</asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateField>

                            <asp:BoundField DataField="createdDate" HeaderText="Created Date" <itemstyle  Visible="false"></itemstyle> SortExpression="createdDate" />
                            <asp:BoundField DataField="createdBy" HeaderText="Created By"  SortExpression="createdBy" />
                            <asp:BoundField DataField="lastUpdated" HeaderText="Last Updated"  SortExpression="lastUpdated" />
                            <asp:BoundField DataField="lastUpdatedBy" HeaderText="Last Updated By" SortExpression="lastUpdatedBy" />                



                        </Columns>
                    </asp:GridView>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:17:06+00:00Added an answer on June 16, 2026 at 1:17 am

    I solved the problem, in a way in which I can also switch the invissibility on and off from a button.

    First I refactored the bounded fields I wanted to hide in this manner:

    <asp:BoundField DataField="createdBy" HeaderText="Created By"  SortExpression="createdBy" >
      <ItemStyle CssClass="fooClass"></ItemStyle>
    </asp:BoundField>
    

    The class fooClass is a empty css class, I used it only so that all the <td> </td> elements which are generated by the bounded field share a common class, thus allowing the jquery script I wrote bellow to hide or show them.

    <script> $(".fooClass").hide(); </script>
    // or 
    <script> $(".fooClass").show(); </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a standard grid filled with a collection, which is filterable. I would
I have standard source code package under Linux which requires to run ./configure make
I have a standard list view setup with backbone that looks something like below.
Is it possible to have standard war deployment, which can be deployed on tomcat
I have a standard code like below to validate xml against xsd, but it
I have a standard form array in PHP like this. I need to account
I have edited the standard GroupBox template as I wanted to customize it. Apart
I have a class which is displayed in a property grid. One of the
I have an ActionResult that returns a View with a grid that show notes
I have standard .net 2.0 gridview control from which i want to get row

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.