Custom Paging in Gridview/ASP.NET 2.0 without DataSource

Discussion in 'ASP .Net Datagrid Control' started by Stefan Broenner, Jul 6, 2005.

  1. Hi,

    I want to implement custom paging in a GridView (ASP.NET 2.0, June 2006 CTP)
    without using a SQL or Object DataSource (for a variety of reasons).

    Our custom paging logic only retrieves a subset of the data from the
    database (e.g. 10 out of 100000 records when the PageSize = 10).

    Binding the data and working with the relevant events works fine.

    However, my problem is that I would need to tell the GridView how many
    records I actually have so that it could display the correct paging UI (right
    now I see only one page instead of 1000).

    Alternatively, I could also provide the number of pages. There is a property
    called PageCount but unfortunately it is read-only.

    Is there any way how I could do this or do I need to go back to the DataGrid
    (which supports this scenario just fine).

    Thanks in advance

    Stefan
     
    Stefan Broenner, Jul 6, 2005
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.