title: Gridview Show and Hide a Specific Column
body: <p>I have a gridview in which a specific column <code>Date</code>. I have set the <code>Visible</code> property of column to false because I want to show on different conditions of page. Please tell me how can I do it using vb.net that my <code>Date</code> column should show or hide at runtime</p>
  
  <p><strong>Update</strong></p>
  
  <p>My current code is</p>
  
  <pre><code>   If Not Page.User.Identity.Name = "bilal" Then
              GridView1.AutoGenerateEditButton = False
  
              GridView2.AutoGenerateEditButton = False
              GridView3.AutoGenerateEditButton = False
          Else
              GridView1.AutoGenerateEditButton = True
              GridView1.AutoGenerateColumns = True
  
              GridView1.DataBind()
              If GridView1.Columns.Count &gt; 0 Then
                  'assuming your date-column is the first '
                  GridView1.Columns(3).Visible = True
              Else
                  GridView1.HeaderRow.Cells(0).Visible = False
                  For Each gvr As GridViewRow In GridView1.Rows
                      gvr.Cells(0).Visible = True
                  Next
              End If
  
  
  
              GridView2.AutoGenerateEditButton = True
              GridView3.AutoGenerateEditButton = True
  
          End If
  </code></pre>