2011-05-24 105 views
0

我有GridView和這個網格有設置分頁,但是這個分頁沒有顯示出來......我該如何解決它?在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> 
+0

您的數據中實際上是否有超過5行? – 2011-05-24 18:09:19

+0

你的ObjectDataSource返回哪種類型? – slfan 2011-05-24 18:15:17

回答

3

問題是RowDataBound事件,我均顯示下行第一(指數0)細胞...刪除此事件發生後,分頁顯示.... 感謝您的回覆。 :)

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(); 
    } 

+1

他說分頁沒有顯示出來。所以這不是他目前的問題。 – 2011-05-31 13:02:55

0
<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" />