开发者

Is custom paging of GridView (in ASP.NET, preferably 3.5) possible without using ObjectDataSource?

开发者 https://www.devze.com 2022-12-13 20:00 出处:网络
See title. Using ObjectDataSource is associated in my mind with quick demos that you can see at conferences and in开发者_如何学编程 video tutorials (which typically tells me \"don\'t do it this way i

See title.

Using ObjectDataSource is associated in my mind with quick demos that you can see at conferences and in开发者_如何学编程 video tutorials (which typically tells me "don't do it this way in production").

Also I always like to have control over what's going on and when it happens. My other problem with ObjectDataSource is that is's declarative.

Looking forward for your help and opinions.

UPDATE: I'm retrieving only one page of results from the database and the GridView.PageCount is read-only [sic!].


Yes, you need to define an PageIndexChanged event handler to perform the actual paging of data from your source before binding to the Data Grid, same idea for sorting but with a SortCommand handler.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号