title: ASP.NET 3.5 Gridview control
body: <p>If you click on the 'search' button in the following link</p>
  
  <p><a href="http://www.bmwusa.com/Standard/Content/CPO/ModelSearch.aspx" rel="nofollow noreferrer">link text</a></p>
  
  <p>A gridview shows up. I am trying to do something similar within a table whose width is set to auto. My current way is to create the gridview in design view, but however, my gridview does not resize to the table width. I understand that I posed 2 different questions in one.</p>
  
  <p>My current gridview is as such. Defined in 'source' view</p>
  
  <pre><code>&lt;asp:GridView ID="gridView" runat="server"
               AutoGenerateColumns="False"
               EnableSortingAndPagingCallbacks="True"
               AllowPaging="True" DataSourceID="FilesByJobObjectDataSource" 
               PageSize="5" OnRowCommand="gridView_RowCommand" DataKeyNames="FileID"  
               HorizontalAlign="Left" &gt;
               &lt;Columns&gt;
                   &lt;asp:BoundField DataField="RID" HeaderText="RID" 
                      ReadOnly="True" ItemStyle-Width="50px"  &gt;
                       &lt;ItemStyle Width="50px" /&gt;
                   &lt;/asp:BoundField&gt;
                  &lt;asp:BoundField DataField="Category" HeaderText="Category" 
                      ReadOnly="True" ItemStyle-Width="100 px" &gt;
                      &lt;ItemStyle Width="100px" /&gt;
                   &lt;/asp:BoundField&gt;
                  &lt;asp:BoundField DataField="FileName" HeaderText="Type" 
                       ReadOnly="True" ItemStyle-Width="575 px" &gt; 
                      &lt;ItemStyle Width="575px" /&gt;
                   &lt;/asp:BoundField&gt;
                  &lt;asp:BoundField DataField="FileID" Visible="false" /&gt;
                  &lt;asp:ButtonField Text="X" ButtonType="Button" ItemStyle-Width="20px" &gt;
                      &lt;ItemStyle Width="20px" /&gt;
                   &lt;/asp:ButtonField&gt;
              &lt;/Columns&gt;
               &lt;RowStyle CssClass="RowStyle" /&gt;
              &lt;EmptyDataRowStyle CssClass="EmptyRowStyle" /&gt;
              &lt;PagerStyle CssClass="PagerStyle" /&gt;
              &lt;SelectedRowStyle CssClass="SelectedRowStyle" /&gt;
              &lt;HeaderStyle CssClass="HeaderStyle" /&gt;
              &lt;EditRowStyle CssClass="EditRowStyle" /&gt;
              &lt;AlternatingRowStyle CssClass="AltRowStyle" /&gt;
       &lt;/asp:GridView&gt;
       &lt;/ContentTemplate&gt;
  </code></pre>