Click here to Skip to main content
14,360,151 members
Rate this:
Please Sign up or sign in to vote.
Hi Team,

How to hide particular column in grid view control?

I want to hide particular columns,
At the same time nested Gridview columns also need to be hide.

Thanks in Advance.
Posted
Comments
george4986 3-Mar-14 6:03am
   
are u using windows or web form
Rate this:
Please Sign up or sign in to vote.

Solution 5

if your column is autogenearted then use
Gridview1.column[index].visible=false;

Otherwise set visible false on aspx page 
 <asp:gridview id="Grid_Show" runat="server" >                       
   <columns>
    <asp:templatefield visible="false">
    <itemtemplate>
        <asp:label id="lblID" runat="server" text="<%#Bind("ID")%>"></asp:label>                                
       </itemtemplate>
     </asp:templatefield>
 </columns>
</asp:gridview>
   
v3
Rate this:
Please Sign up or sign in to vote.

Solution 1

   
v2
Rate this:
Please Sign up or sign in to vote.

Solution 2

   
Rate this:
Please Sign up or sign in to vote.

Solution 4

gv.column[colIndex].Visible=false;
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100