title: setting the width of the grid view column to dynamic without compromising the minimum width for the control
body: <p>I'm using </p>
  
  <pre><code>&lt;asp:GridView ID="Grid1"  runat="server" AutoGenerateColumns="False"  BorderWidth="0px" BorderColor="white" BorderStyle="Solid"&gt;
  
  &lt;asp:TemplateField HeaderText="tf1" ControlStyle-Width="40px"&gt;  
  &lt;ItemTemplate&gt;    
  &lt;asp:Label ID="lbl1" runat="server" Text='&lt;%# String.Format("{0:###,###,###,##0}",Convert.ToInt64(DataBinder.Eval(Container.DataItem,"tf1"))) %&gt;' /&gt;
  &lt;asp:TextBox id="txt1" runat="server" Text='&lt;%# Eval("tf1") %&gt;'  style="display:none;text-align:right;" MaxLength = "9"  /&gt;  
  &lt;/ItemTemplate&gt;                                         
  &lt;/asp:TemplateField&gt; 
  
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>The problem is eventhough the ConrolStyle-Width is set to 40 px, I want it to be dynamic in size to accomodate data which requires more than 40px space. How can I achieve this?</p>