You should hide the Column. Don't set Visibility to false, otherwise it won't render the control.
Write below code in
GridView
RowCreated
Event.
Here Cell 0 means first Column is used. You have to replace 0 with your required Column index.
protected void OnRowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].CssClass = "hiddencol";
}
else if (e.Row.RowType == DataControlRowType.Header)
{
e.Row.Cells[0].CssClass = "hiddencol";
}
}
Write the following CSS on the
aspx
page.
.hiddencol
{
display:none;
}