Click to See Complete Forum and Search --> : how to page GridView


jasonli
December 11th, 2006, 06:03 PM
I have a gridview and bind a dataset to it. I set AllowPaging="True", and EnableSortingAndPagingCallbacks="True" because of TemplateFields in it.

When I click numeric button, nothing happen. PageIndex of GridView is 0.

So how can I do?

mcmcom
December 14th, 2006, 05:36 PM
use a PagedDataSource

see here:
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.pageddatasource.aspx

hth,
mcm

jasonli
December 15th, 2006, 08:59 AM
Thank you for your reply, mcmcom. It's working with PagedDatasource. However, I'm still wondering why GridView can't do paging by itself. Anyone knows about that?

mcmcom
December 15th, 2006, 02:05 PM
i dont think they can page without a paged datasource. The paged data source acts like a controller, filtering only records that match where the "page" is.

hth,
mcm