开发者

How to only bind gridview after a button click?

开发者 https://www.devze.com 2023-02-18 14:06 出处:网络
I have a grid view, that is using ObjectDataSource i开发者_StackOverflows it\'s source. is it possible to only bind the gridview, after i click a button, and have it initially be blank...but keep usi

I have a grid view, that is using ObjectDataSource i开发者_StackOverflows it's source.

is it possible to only bind the gridview, after i click a button, and have it initially be blank...but keep using ObjectDataSource?


It is possible.

Register an Click event on the button and handle the binding of the GridView in the handler for the button click.

If you want the GridView "blank" initially, bind it to an empty IEnumerable of the type you're binding to. It wont contain any rows, but the header will be there.

0

精彩评论

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

关注公众号