Syncfusion - 2 - Persisting user customisations of a GridGroupingControl between runs.

[ESS 7.3.0.20, C# 2.0]

Suppose you use a GridGroupingControl grid in your application and you allow the users to customise its look-n-feel. You want to persist those customisations from one run to the next, but how? Start by adding the following two methods into your form:

Now call SetGridProperties() in the form (after the data has been loaded or bound) passing it the name of the grid and some unique ID string. Also had a call to SaveGridProperties() in the form's unloading method. What this will do is store the customised grid settings in two XML files when the program ends, and load them up again at the start of the next run. If those XML files don't exist (which they wont the first time) the program will resize each column to hold the data and continue.

As coded the XML files will be writen to the application's directory … you may wish to change this (especially if the user doesn't have write access).

.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License