vendredi 27 février 2015

asp.net paging changes height

title says it all, I have a gridview, and the second page does not fill the 10 places so it changes height, I need the gridview to stay the same no matter what. I will change to whatever I need to get this done, Ive tried everything I can find online like taking out the height attribute and moving it to css, nothing has worked. I also tried all of the answers here and they did not work either...GridView paging problem!


the CSS i tried is:



.RowStyle {
height: 50px;
}
.AlternateRowStyle {
height: 50px;
}


and the HTML I am using currently is:



<asp:Panel runat="Server" ID="AnonymousMessagePanel">
<br />
<asp:GridView ID="CompletedProjectsGrid" runat="server" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="ProjectsClosedList"
EnableViewState="False" DataKeyNames="ProjectID" CssClass="mGrid" PagerStyle-CssClass="pgr" RowStyle-CssClass="RowStyle"
AlternatingRowStyle-CssClass="alt" AllowPaging="true" PageSize="10">
<Columns>
<asp:BoundField DataField="ProjectID" HeaderText="ProjectID" HeaderStyle-ForeColor="White" SortExpression="ProjectID" ReadOnly="True" ItemStyle-Width="11%"/>
<asp:BoundField DataField="ProjectName" HeaderText="ProjectName" HeaderStyle-ForeColor="White" SortExpression="ProjectName" ItemStyle-Width="11%"/>
<asp:BoundField DataField="TesterName" HeaderText="TesterName" HeaderStyle-ForeColor="White" SortExpression="TesterName" ItemStyle-Width="11%"/>
<asp:BoundField DataField="ProjectDescription" HeaderText="ProjectDescription" HeaderStyle-ForeColor="White" SortExpression="ProjectDescription" ItemStyle-Width="11%"/>
<asp:BoundField DataField="Platform" HeaderText="Platform" HeaderStyle-ForeColor="White" SortExpression="Platform" ItemStyle-Width="11%"/>
<asp:BoundField DataField="DueDate" HeaderText="DueDate" HeaderStyle-ForeColor="White" SortExpression="DueDate" dataformatstring="{0:M/dd/yyyy}" ItemStyle-Width="11%"/>
<asp:BoundField DataField="DateAssigned" HeaderText="DateAssigned" HeaderStyle-ForeColor="White" SortExpression="DateAssigned" dataformatstring="{0:M/dd/yyyy}" ItemStyle-Width="11%"/>
<asp:BoundField DataField="DocumentName" HeaderText="DocumentName" HeaderStyle-ForeColor="White" SortExpression="DocumentName" ItemStyle-Width="11%"/>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="ProjectsClosedList" runat="server"
ConnectionString="<%$ ConnectionStrings:ProjectsAndTasksTestConnectionString %>"
SelectCommand="SELECT [ProjectID], [ProjectName], [TesterName], [ProjectDescription], [Platform], [DueDate], [DateAssigned], [DocumentName] FROM [Projects] WHERE ([DateCompleted] IS NULL)">
</asp:SqlDataSource>
</asp:Panel>


Note: all of these ways do actually run and work, they just all change height of the gridview when there is only 2/10 on the last page, and I need it the same height no matter what is in the page


Aucun commentaire:

Enregistrer un commentaire