title: Auto-Size Columns In DataGrid
body: <p>This is my HTML for my grid, how can I set the columns to auto-fit so that one column is not really huge when it is not needed?  I know I can manually set the size, but I would rather it auto-size as some store names are longer than others and some manager names are longer than others so a pre-determined size isn't a good option.</p>
  
  <pre><code>      &lt;asp:DataGrid runat="server" ID="dtgMain" AutoGenerateColumns="false"
  CssClass="DataGrids" GridLines="Both" ShowFooter="true" OnItemCommand="dtgMain_OnItemCommand"&gt;
    &lt;ItemStyle CssClass="row" /&gt;
    &lt;FooterStyle CssClass="DataGridFooters" /&gt;
    &lt;HeaderStyle CssClass="DataGridHeaders" /&gt;
    &lt;Columns&gt;
      &lt;asp:BoundColumn DataField="storename" HeaderText="storename"&gt;&lt;/asp:BoundColumn&gt;
      &lt;asp:BoundColumn DataField="hours" HeaderText="hours"&gt;&lt;/asp:BoundColumn&gt;
      &lt;asp:BoundColumn DataField="Date" HeaderText="Today's Date" DataFormatString="{0:d}"&gt;&lt;/asp:BoundColumn&gt;
      &lt;asp:BoundColumn DataField="manager" HeaderText="Store Manager"&gt;&lt;/asp:BoundColumn&gt;
      &lt;asp:BoundColumn DataField="Owner" HeaderText="Store Owner"&gt;&lt;/asp:BoundColumn&gt;
    &lt;/Columns&gt;
    &lt;/asp:DataGrid&gt;
  </code></pre>