GridView中的分页不显示

时间:2011-05-24 18:06:24

标签: asp.net gridview paging

我有GridView,这个网格有设置分页,但这个分页没有显示......我该如何解决?

<asp:ObjectDataSource ID="odsUzivatele" runat="server" SelectMethod="VratUzivatele" 
    TypeName="ManagerUzivateleAdapter"></asp:ObjectDataSource>
<asp:GridView ID="gwUzivatele" runat="server" 
    DataSourceID="odsUzivatele" onrowdatabound="gwUzivatele_RowDataBound" 
    AllowPaging="True" PageSize="5" EnableModelValidation="True">
</asp:GridView>

3 个答案:

答案 0 :(得分:3)

问题出现在RowDataBound事件中,我向下显示第一个(索引0)单元格...删除此事件后,分页显示.... 谢谢回复。 :)

答案 1 :(得分:0)

<asp:GridView ID="grdList" runat="server" AutoGenerateColumns="False" 

            GridLines="None" PageSize="4" AllowPaging="True"
            EmptyDataText="No record found" 
            onpageindexchanging="grdList_PageIndexChanging"

    protected void grdList_PageIndexChanging(object sender, GridViewPageEventArgs e)    
    {
        grdList.PageIndex = e.NewPageIndex;
        fillgrid();
    }

答案 2 :(得分:-1)

<asp:GridView
                    ID="gvFercDocket" runat="server" AllowPaging="True" AllowSorting="True"
                    AutoGenerateColumns="True" DataKeyNames="FERCDocket_Id" CssClass="tableHeader"
                    DataSourceID="EDSFERCDocket" Width="900px" ShowFooterWhenEmpty="true" ShowHeaderWhenEmpty="true"
                    ShowFooter="true" ShowHeader="true" OnRowCreated="gvFercDocket_RowCreated" PageSize="10">
                    <PagerSettings PageButtonCount="10" Visible="False" />