Making a particular column of a gridview hidden in Asp.net C#

Step (1)

Suppose you have a bound  field namely UNIQUEID that you don't want to be displayed then you just apply the following properties to your bound field.

<asp:BoundField DataField="UNIQUEID" HeaderText="Unique id" ItemStyle-CssClass="MakeHidden" HeaderStyle-CssClass="MakeHidden">
    <HeaderStyle CssClass="MakeHidden"></HeaderStyle>

    <ItemStyle CssClass="MakeHidden"></ItemStyle>
</asp:BoundField>

Step (2)

Then add the following css

.MakeHidden
 {
    display:none;
}
       
Ebook Download
View all
Learn
View all