0

I work in listView with datapager control and create paging for list view as follows:

 <asp:ListView ID="lvList" runat="server">
    <LayoutTemplate>
        <ul>
            <li runat="server"></li>
        </ul>
    </LayoutTemplate>
    <ItemTemplate>
        <li>
            </li>
    </ItemTemplate>
</asp:ListView>
 <asp:DataPager ID="List" runat="server" PageSize="10" PagedControlID="lvList">
    <Fields>
       <asp:NumericPagerField ButtonType="Button" />
    </Fields>
 </asp:DataPager>

and I retrieve list of paged data to listview, in every page number changed data for list view will bound and get 10 rows throught specific function like this:

// this code retrieve list<> contains 10 rows
lvList.DataSource=RetrievePaged(pageNumber,pageSize,sortExpression);
lvList.DataBind();

when run this paging not work because the TotalRowCount=10. How I can change this property and set it to be total number of rows in table?

Anas Jaber
  • 583
  • 1
  • 7
  • 20
  • I found answer of my question in this link http://stackoverflow.com/questions/3204600/how-do-i-use-a-datapager-with-server-side-paging – Anas Jaber Jan 22 '12 at 12:15

1 Answers1

-1

let "list" be your datapager: list.PageSize = 10 the code above does the thing,piece of cake;)