
DNV Cleaner Energy
Top achievements
Rank 1
DNV Cleaner Energy
asked on 21 Oct 2010, 08:24 PM
I have a RadGridView that would allow the user to persist layout settings via the SaveLayout() and LoadLayout() methods. Is there a way in which the user can clear all the layout settings applied... something equivalent to a radgridview.ClearLayout() perhaps?
5 Answers, 1 is accepted
0

Emanuel Varga
Top achievements
Rank 1
answered on 21 Oct 2010, 09:01 PM
Hello DNV Cleaner Energy,
The easiest way to accomplish this is to just reset the DataSource for the Grid, set it to null, and set it back again, this will reset the grid to it's original state.
Hope this helps, if you have any other questions or comments, please let me know,
Best Regards,
Emanuel Varga
The easiest way to accomplish this is to just reset the DataSource for the Grid, set it to null, and set it back again, this will reset the grid to it's original state.
Hope this helps, if you have any other questions or comments, please let me know,
Best Regards,
Emanuel Varga
0

Richard Slade
Top achievements
Rank 2
answered on 21 Oct 2010, 10:03 PM
Hi,
What we tend to do, rather than resetting the datasource, is to save a layout the first time the user goes to the grid. If they then save a custom layout, then we have the original to revert back to.
Emanuel's way will also work but in our application, I've found that this is quicker for us.
Regards,
Richard
What we tend to do, rather than resetting the datasource, is to save a layout the first time the user goes to the grid. If they then save a custom layout, then we have the original to revert back to.
Emanuel's way will also work but in our application, I've found that this is quicker for us.
Regards,
Richard
0

Emanuel Varga
Top achievements
Rank 1
answered on 21 Oct 2010, 10:25 PM
Hello Richard,
Do you think It's quicker and better for performance to keep a layout (just in case) and restore a layout than just rebinding?
The layout Save / Load operations is using XML Serialization, which usually is very slow, at least in my point of view.
Best Regards,
Emanuel Varga
Do you think It's quicker and better for performance to keep a layout (just in case) and restore a layout than just rebinding?
The layout Save / Load operations is using XML Serialization, which usually is very slow, at least in my point of view.
Best Regards,
Emanuel Varga
0

Richard Slade
Top achievements
Rank 2
answered on 21 Oct 2010, 10:31 PM
Hi.
In our case it turned out to be as quick and works really well though I'm now interested to go back to a couple of our larger grids to retry both methods.
Regards
Richard
0

Richard Slade
Top achievements
Rank 2
answered on 22 Oct 2010, 09:33 AM
Hi Again All,
Emanuel - I've tried it again on some of our larger grids and yes, it does tend to be slightly quicker. But, the trouble with reseting the datasource is that if you have any column properties set (for example, which columns are visible etc..) these are lost whereas by using a default layout file, we can preserve this default information (unless you know a way around that)
Regards,
Richard
Emanuel - I've tried it again on some of our larger grids and yes, it does tend to be slightly quicker. But, the trouble with reseting the datasource is that if you have any column properties set (for example, which columns are visible etc..) these are lost whereas by using a default layout file, we can preserve this default information (unless you know a way around that)
Regards,
Richard