首页 > 代码库 > DataGridView隐藏列用CSS实现

DataGridView隐藏列用CSS实现

 隐藏DataGridView某一列,用CSS控制 

CSS Code:

  .hidden{ display:none;}

c# Code:

<asp:BoundField DataField="id" HeaderText="id">

  <ControlStyle CssClass="hidden" />

  <ItemStyle CssClass="hidden" />

  <HeaderStyle CssClass="hidden" />

  <FooterStyle CssClass="hidden" />

</asp:BoundField>