title: ASP.NET Set GridView Column max width size
body: <p>I am using ASP.NET C# on VS2005. </p>
  
  <p>I have a GridView table with a column named <code>Description</code>, and since the input is always very long, the description is very long horizontally. </p>
  
  <p>I would want the GridView to have a max width size for all columns. </p>
  
  <p>I have tried many ways but none of them worked.</p>
  
  <p><code>ItemStyle-Width="50px"</code>, </p>
  
  <p><code>HeaderStyle-BorderWidth="50px"</code>,</p>
  
  <p><code>HeaderStyle-Width="50px"</code>, </p>
  
  <p><code>RowStyle-Width="50px"</code>,</p>
  
  <p><code>Width="50px"</code></p>
  
  <p>Below is a code snippet of my GridView:</p>
  
  <pre><code>&lt;asp:GridView ID="GridView1" AutoGenerateEditButton="True" ondatabound="gv_DataBound" runat="server" DataSourceID="SqlDataSource1"&gt;
      &lt;Columns&gt;
          &lt;asp:TemplateField&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:CheckBox ID="UserSelector" OnCheckedChanged="UserSelector_CheckedChanged" ondatabound="gv_DataBound" runat="server" /&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
      &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>Anyone know how to adjust the size of GridView columns based on my situation?</p>