title: Hiding columns in ASP.Net Datagrid
body: <p>My <code>DataGrid</code> is something like this:</p>
  
  <pre><code>&lt;asp:DataGrid ID="tasks" runat="server" AutoGenerateColumns="False" GridLines="None"&gt;
      &lt;HeaderStyle CssClass="task-list-header"/&gt;
      &lt;ItemStyle  CssClass="task-list-row"/&gt;
      &lt;Columns&gt;
          &lt;asp:BoundColumn DataField="Name"
                           HeaderStyle-Width="100px"
                           HeaderText="Name"&gt;&lt;/asp:BoundColumn&gt;
          &lt;asp:BoundColumn DataField="Description"
                           HeaderStyle-Width="250px"
                           HeaderText="Description"&gt;&lt;/asp:BoundColumn&gt;
          &lt;asp:BoundColumn DataField="IsComplete"
                           HeaderStyle-Width="125px"
                           HeaderText="Is Complete"&gt;&lt;/asp:BoundColumn&gt;
          &lt;asp:TemplateColumn&gt;
              &lt;HeaderStyle Width="75px"/&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:HyperLink ID="Hyperlink1" runat="server"
                      NavigateUrl='&lt;%# ModuleContext.EditUrl("TaskId", Eval("TaskId").ToString(), "EditTask") %&gt;'
                      Text="Edit"&gt;&lt;/asp:HyperLink&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateColumn&gt;
          &lt;asp:TemplateColumn&gt;
              &lt;HeaderStyle Width="75px"/&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:LinkButton ID="LinkButton1" runat="server"
                      CommandArgument='&lt;%# Eval("TaskId") %&gt;' CommandName="Delete" Text="Delete"&gt;&lt;/asp:LinkButton&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateColumn&gt;
      &lt;/Columns&gt;
  &lt;/asp:DataGrid&gt;
  </code></pre>
  
  <p>This is basically a list of Task with Last 2 columns as <code>Edit</code> and <code>Delete</code>. I am using DNN8. I want to hide the <code>Edit</code> and <code>Delete</code> links if the user is not logged in as Superuser. How can I do that? I also tried the property <code>OnAutoBinding</code> but no luck. </p>
  
  <p>Thanks, in advance for the help.</p>