CompletIT Community Server

Welcome to CompletIT Community Server Sign in | Join | Help

Code Sample: How to change the Xml persistence folder.

  •  09-15-2007, 1:03 AM

    Code Sample: How to change the Xml persistence folder.

    It is possible to change the default folder where all Xml data is saved, you just have to insert the following lines of code in your application:

    1. Add reference to the main assembly ‘DataGridViewExtension.dll’ and to any of the export dlls you wish to be supported. The assemblies can be found in folder 'v1.1.1\Bin' in the installation\archive.


    2. Ensure you have the following imports:
    C#
    using CompletIT.Windows.DataGridViewExtension;
    using CompletIT.Windows.DataGridViewExtension.Persistence;

    VB.NET
    Imports CompletIT.Windows.DataGridViewExtension
    Imports
    CompletIT.Windows.DataGridViewExtension.Persistence


    3. Then add the following lines of code in order to change the persistence folder:
    C#
    //The new destination folder should be existing
    DGVEXmlPersistenceManager.ExtensionSettingsPath = "C:\\MyNewPersistenceFolder";
    DataGridViewExtensionComponent.Extension.UpdateAllGridsWithPersistedSettings();
    DGVEThemesManager.UpdateListWithSavedThemes();

    VB.NET
    'The new destination folder should be existing
    DGVEXmlPersistenceManager.ExtensionSettingsPath = "C:\\MyNewPersistenceFolder"
    DataGridViewExtensionComponent.Extension.UpdateAllGridsWithPersistedSettings()
    DGVEThemesManager.UpdateListWithSavedThemes()


    4. Run your application!

    Filed under: , ,
View Complete Thread
Powered by Community Server (Personal Edition), by Telligent Systems