ObjectDataSource: needs to 'show all records' on demand instead of paging
I have a GridView and ObjectDataSource set up to do custom paging and everything was fine. Now the client wants a 'show all' button. In the event handler for this button, what can I 开发者_运维知识库do to achieve this?
Thanks for your time.
If you want show all records on a button click, then its better to set AllowPaging = false
on the button's Click handler. It will simply disable the paging feature and bind all the records to the gridview:
Gridview1.AllowPaging = false;
Gridview1.DataBind();
精彩评论