如何使用asp.net隐藏gridview控件中的特定列?

问题描述:

Hi Team,



如何隐藏网格视图控件中的特定列?



我想要隐藏特定的列,

同时嵌套的Gridview列也需要隐藏。



先谢谢。

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.

如果您的列是自动生成的,那么使用

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>


请看下面的链接:

用于隐藏ASP.NET GridView中具有自动生成列的列? [ ^ ]

隐藏GridView中的列 [ ^ ]
Please have a look on the bellow link :
ow to hide columns in an ASP.NET GridView with auto-generated columns?[^]
Hiding column in GridView[^]


试试这篇文章

显示/隐藏GridView ASP.NET中的列 [ ^ ]