How can I unbind a GridView?

  • Thread starter Thread starter AAaron123
  • Start date Start date
A

AAaron123

I first do:

DataGrid1.DataSource = ds2.Tables(0).DefaultView

DataGrid1.DataBind()



At some later time I want to set the DataGrid1 back to its original state.

That is I want to "unbind" it.



How can I do that?



Thanks
 
Thanks

I'm pretty sure you can just do this:

DataGrid1.DataSource = Nothing
DataGrid1.DataBind()

David

======================================
David McCarter [Microsoft MVP]
www.dotNetTips.com
David McCarter''''s .NET Coding Standards available at:
http://codingstandards.notlong.com


AAaron123 said:
I first do:

DataGrid1.DataSource = ds2.Tables(0).DefaultView

DataGrid1.DataBind()



At some later time I want to set the DataGrid1 back to its original
state.

That is I want to "unbind" it.



How can I do that?



Thanks
 
Back
Top