ASP.NET 3.5 Gridview Control

If you click the "Search" button in the following link

link text

The gridview will appear. I am trying to do something like this on a table whose width is set to auto. My current way is to create a gridview in design view, but however my gridview is not resizing the table. I understand that I have posed two different questions in one.

My current gridview as such. Defined in source view

<asp:GridView ID="gridView" runat="server"
             AutoGenerateColumns="False"
             EnableSortingAndPagingCallbacks="True"
             AllowPaging="True" DataSourceID="FilesByJobObjectDataSource" 
             PageSize="5" OnRowCommand="gridView_RowCommand" DataKeyNames="FileID"  
             HorizontalAlign="Left" >
             <Columns>
                 <asp:BoundField DataField="RID" HeaderText="RID" 
                    ReadOnly="True" ItemStyle-Width="50px"  >
                     <ItemStyle Width="50px" />
                 </asp:BoundField>
                <asp:BoundField DataField="Category" HeaderText="Category" 
                    ReadOnly="True" ItemStyle-Width="100 px" >
                    <ItemStyle Width="100px" />
                 </asp:BoundField>
                <asp:BoundField DataField="FileName" HeaderText="Type" 
                     ReadOnly="True" ItemStyle-Width="575 px" > 
                    <ItemStyle Width="575px" />
                 </asp:BoundField>
                <asp:BoundField DataField="FileID" Visible="false" />
                <asp:ButtonField Text="X" ButtonType="Button" ItemStyle-Width="20px" >
                    <ItemStyle Width="20px" />
                 </asp:ButtonField>
            </Columns>
             <RowStyle CssClass="RowStyle" />
            <EmptyDataRowStyle CssClass="EmptyRowStyle" />
            <PagerStyle CssClass="PagerStyle" />
            <SelectedRowStyle CssClass="SelectedRowStyle" />
            <HeaderStyle CssClass="HeaderStyle" />
            <EditRowStyle CssClass="EditRowStyle" />
            <AlternatingRowStyle CssClass="AltRowStyle" />
     </asp:GridView>
     </ContentTemplate>

      

0


source to share


1 answer


Don't set column width ....



+1


source







All Articles