Hide a Column in ASP.Net gridview from Code behind file.

Ndebata
Posted by Ndebata under ASP.NET category on | Points: 40 | Views : 7531
var actioncol = gvUser.Columns.Cast<DataControlField>().Where(c => c.HeaderText.Equals("ColumnName")).FirstOrDefault();
if (actioncol != null)
{
actioncol.Visible = false;
}


Regards,
Debata

Comments or Responses

Login to post response