Click here to Skip to main content
15,891,905 members
Articles / Web Development / ASP.NET

Show / Hide GridView Columns in ASP.NET

Rate me:
Please Sign up or sign in to vote.
4.82/5 (17 votes)
12 Nov 2009CPOL4 min read 315.6K   5.1K   61  
Give users the ability to show or hide GridView columns as they require.
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Show / Hide Gridview Columns</title>
    <asp:ContentPlaceHolder id="HeadContent" runat="server">
    
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">    
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <div>
        <asp:ContentPlaceHolder id="BodyContent" runat="server">
        
        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Chief Technology Officer
Ireland Ireland
I have been designing and developing business solutions for the aviation, financial services, healthcare and telecommunications industries since 1999. My experience covers a wide range of technologies and I have delivered a variety of web and mobile based solutions.

Comments and Discussions