Can I make my collection "data pageable"?

R

Rob Meade

Hi all,

I have my own collection own which implements ienumerable and ienumator.

I was recently using a GridView and I was prompted that I could not turn on
paging because the data source (my collection) was not data pageable. I
subsequently added a property to my collection to return the data as a
datatable and all was good, however, I would much prefer to not do this, and
keep the source as my collection.

Thus, is it possible to make my collection data pageable?

Any info would be appreciated.

Regards

Rob
 
C

ca8msm

Hi all,

I have my own collection own which implements ienumerable and ienumator.

I was recently using a GridView and I was prompted that I could not turn on
paging because the data source (my collection) was not data pageable. I
subsequently added a property to my collection to return the data as a
datatable and all was good, however, I would much prefer to not do this, and
keep the source as my collection.

Thus, is it possible to make my collection data pageable?

Any info would be appreciated.

Regards

Rob

Yes, there's a couple of ways you could do this. One way would be to
use the PagedDataSource class and return an instance of that from your
class. If you want to see how this class can be used by a control, you
can have a look at the example here:

http://aspnetlibrary.com/articledetails.aspx?article=Add-paging-to-a-repeater
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Top