Search code examples
asp.netdatapager

DataPager, change count items


I'm using a DataPager control, I want to change count items on each page.

For example : the First page 6 rows, the second page 311, the third page 12, etc.

Is it possible? If so, how?


Solution

  • my advice is to do it manually, make your own sql query and customize the page size as you want

    here are some tips that can help

    • to get range of rows that are needed for pagination user the row number

    MS-sql row number

    • use the TOP to get the upper set of rows

      select TOP 5 * from ....

    • for sure you'll need to get specific row numbers that will be displayed in the current page

      select (--get row number--) from tbl_smth where row_num>5 and row_num<10

    were as i guess that you have the page sizes in an array so you have to count them to determine the two numbers {5,10}

    hope this will help