locked
Gridview won't stop paging RRS feed

  • Question

  • User-839404437 posted
    <%@ Control Language="VB" AutoEventWireup="false" CodeFile="FileGridVB.ascx.vb" Inherits="UserControls_FileGridVB" %>
    <p>
        <asp:Label ID="lblCurrentPath" runat="server"></asp:Label>
    </p>

    <asp:GridView ID="gvFiles" runat="server" AllowPaging="false" AutoGenerateColumns="False"
        CellPadding="4" ForeColor="#333333" GridLines="Horizontal" Height="80px"
        PageSize="1">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:TemplateField HeaderText="Name" SortExpression="Name">
                <ItemTemplate>
                    <asp:LinkButton runat="server" ID="lbFolderItem" CommandName="OpenFolder" CommandArgument='<%# Eval("Name") %>'></asp:LinkButton>
                    <asp:Literal runat="server" ID="ltlFileItem"></asp:Literal>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="FileSystemType" HeaderText="Type"
                SortExpression="FileSystemType" />
            <asp:BoundField DataField="LastWriteTime" HeaderText="Date Modified"
                SortExpression="LastWriteTime" />
            <asp:TemplateField HeaderText="Size" SortExpression="Size" ItemStyle-HorizontalAlign="Right">
                <ItemTemplate>
                    <%# DisplaySize(CType(Eval("Size"), Nullable(Of Long))) %>
                </ItemTemplate>

    <ItemStyle HorizontalAlign="Right"></ItemStyle>
            </asp:TemplateField>
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White"
            Wrap="False" />
        <PagerSettings PageButtonCount="500" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>

    Hi, You can see that I've set AllowPaging to false but yet the results constantly pages every 10 items returned.

    I'm sure Im missing something stupid.

    Any help would be greatly appreciated.

    Tuesday, January 28, 2014 2:48 PM

Answers

  • User-484054684 posted

    You could check the following:

    1. Make sure your page is not cached at browser - click Ctrl + F5 to ensure the request goes to the server or put break point on code behind to ensure it hits the server code.

    2. Make sure your page is not output cached. Better to do iisreset once.

    3. You could also try removing PageSize="1" attribute, as this is no longer needed.

    4. If you are using WebApplication, instead of WebSite - then make sure you have built the application and only then your changes will be reflected.

    5. Cross check the timestamp of the latest WebApplication dll in the Bin folder to make sure the output directories of your application is on the right location.

    6. Check if you have overwritten the AllowPaging setting on the code behind (cs) file.

    7. Last but not least, make sure there is no themes or skins for your application!
        For example: Check if you have themes configured in your web.config file like below: <pages theme="YourTheme"> 
        To understand more on the themes and skins concept: http://www.developer.com/net/article.php/3838596/Implementing-Skins-and-Themes-for-ASPNET.htm

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 28, 2014 3:38 PM

All replies

  • User-484054684 posted

    You could check the following:

    1. Make sure your page is not cached at browser - click Ctrl + F5 to ensure the request goes to the server or put break point on code behind to ensure it hits the server code.

    2. Make sure your page is not output cached. Better to do iisreset once.

    3. You could also try removing PageSize="1" attribute, as this is no longer needed.

    4. If you are using WebApplication, instead of WebSite - then make sure you have built the application and only then your changes will be reflected.

    5. Cross check the timestamp of the latest WebApplication dll in the Bin folder to make sure the output directories of your application is on the right location.

    6. Check if you have overwritten the AllowPaging setting on the code behind (cs) file.

    7. Last but not least, make sure there is no themes or skins for your application!
        For example: Check if you have themes configured in your web.config file like below: <pages theme="YourTheme"> 
        To understand more on the themes and skins concept: http://www.developer.com/net/article.php/3838596/Implementing-Skins-and-Themes-for-ASPNET.htm

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 28, 2014 3:38 PM
  • User-1716253493 posted

    Check your code behind, It should pages every 1 item instead of every 10 items

    Tuesday, January 28, 2014 8:24 PM