Search code examples
gridviewcustompaging

Problem in Custom Paging with ASP.NET 2.0 GridView


I have a Database table containing product information as follows: ProductID, KeywordID, ProductDescription

and there are some keywords stored in a Keyword table as Keyword ID, KeywordDescription

I have to show a paged report for products on a page containing the gridview and a combo box - The Keyword is selected in a combo box and the Gridview shows paged information for the Keyword. Obviously I cannot use the rowid approach to implement paging here because all the products related to different keywords are in the same table.

Can someone suggest a good solution. Thanks


Solution

  • Well I did this one myself after googling for it: I created a synthetic RowID which is a continuous number using following SQL portion:

    "ROW_NUMBER() OVER (ORDER BY ) AS ResultSetRowNumber"

    To be honest, I lost track of the post which helped me achieve this. I will post the link soon as I find it.