mark_me wrote:
i can use linq to select and skip data
I don't know anything about the problem domain you are working on and data structures you use. But if database is your persisting area, efficient way to do this is to get only rows that will be displayed.
mark_me wrote:
Again i found solutions on google but none had numbered pages in bottom of gridview, which i want to have. I can do it with next,prev btn at the moment.
IMO, there is nothing wrong in using
ObjectDataSource
since it comes with inbuilt paging capabilities. If you are binding a
DataTable
, you need to set the
TypeName
property to
DataTable
.
You need to provide two methods, one for selecting the data according to the page number and another method for calculating the total count of data. These methods should be assigned to
SelectMethod
and
SelectCountMethod
properties respectively.
Scott Guthrie's
article[
^] gives an overview of doing this. He is using ASP.NET AJAX but the concepts are same.
:)