How to only bind gridview after a button click?
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.
精彩评论