After a user has moved around columns and changed the sort order in a grid, I would like them to be able to reset the layout to the original. Is there a way to do this with code and without closing & opening the form again?
Well, the design-time settings are not saved anywhere internal to the grid. You would have to handle this yourself. You can save the layout of the grid to a stream, though. So you could put other things into that stream, like maybe some sort of version number. Then when the version of your application changes, you could check it against the version in the saved layout file and if they are different, not load the layout.
Thanks Mike.
Is there a way to tell if a changes to the grid layout were applied (new column, sort order, etc), and clear out the layout to the design time settings when a new version of an app is deployed?
Also, to give you more background, I'm saving the layout in the user scoped settings, and deploying the app with Clickonce.
Hi Thomas,
The grid's DisplayLayout has Save and Load methods. So you could save the layout and store it in a stream or a file. Then you could give the user a reset button that loads the layout.