title: how to change the position of the added itemtemplate in gridview in asp.net
body: <p>I have a gridview with a stored proc datasource
  when i try to fill out the datagrid, i cannot control the position of the columns, when i add an additional item template, it is automatically positioned on the right but i want it to be on the left side. what should i do?</p>
  
  <p>i want the edit linkbuttons to be placed on the left after the date total</p>
  
  <p>Gridview Code:</p>
  
  <pre><code>&lt;asp:GridView ID="ListView1" runat="server" DataSourceID="dsSched"&gt;
      &lt;Columns&gt;
      &lt;asp:TemplateField&gt; 
         &lt;ItemTemplate&gt; &amp;nbsp;&amp;nbsp; &lt;asp:LinkButton ID="LinkButton1" runat="server"&gt;Edit&lt;/asp:LinkButton&gt; &amp;nbsp;&amp;nbsp; &lt;asp:LinkButton ID="LinkButton2" runat="server"&gt;Cancel&lt;/asp:LinkButton&gt; 
         &lt;/ItemTemplate&gt;
      &lt;/asp:TemplateField&gt;
      &lt;/Columns&gt;
   &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>i've got this right by using the rowdatabound event</p>
  
  <pre><code>protected void ListView1_RowDataBound(object sender, GridViewRowEventArgs e)
  {
      // Retrieve row
      GridViewRow row = e.Row;
  
      // Intitialize TableCell list
      List cells = new List();
  
      foreach (DataControlField column in ListView1.Columns)
      {
          // Retrieve first cell
          TableCell cell = row.Cells[0];
  
          // Remove cell
          row.Cells.Remove(cell);
  
          // Add cell to list
          cells.Add(cell);
      }
  
      // Add cells
      row.Cells.AddRange(cells.ToArray());
  }
  </code></pre>