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>

你可能感兴趣的:(DataGridView隐藏列用CSS实现)