Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2275
Save Customization
posted

Which event do I trap just before the grid closes so I can save customization?

Thank you.

  • 35319
    posted

    Hello,

     

    I am just checking your progress on the issue.

     

    If you require any further assistance please do not hesitate to ask.

  • 35319
    posted

    Hello Mike,

     

    I have been searching for a solution for your issue and I can suggest you handle the ‘Closed’ event of the ‘MainWindow’ of your WPF application  to call the ‘SaveCustomization’ method in its body.

    So your customizations will be automatically saved in a layout file (.xml) each time when you close the application. For example :

     

    private void Window_Closed(object sender, EventArgs e)

            {

                using (FileStream fs = new FileStream("xamDataGridLayout1.xml", FileMode.Create, FileAccess.Write))

                {

                    this.xamDataGrid1.SaveCustomizations(fs);

                }

            }

     

    If you require any further assistance, please do not hesitate to ask.