Friday, December 1, 2017

Hide GridView BoundField column with value accessible through JavaScript

To hide a BoundField column but make it's value still accessible through JavaScript just set column's ItemStyle-CssClass and HeaderStyle-CssClass properties using CSS class with value display:none.
CSS
.hiddenColumn{
 display:none;
}
ASPX
<asp:BoundField DataField="GroupCode" HeaderText="Group Code" ItemStyle-CssClass="hiddenColumn" HeaderStyle-CssClass="hiddenColumn"/>

0 comments:

Post a Comment