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
860
Save/LoadCustomizations to stream instead of file?
posted

Hello, I'm looking to see if it's possible to save customizations of a datagrid to a stream such as memorystream, and how it would be tied in for load/unload, so that when a datagrid is unloaded (such as when changing to a new tab or a secondary grid) the grid can then have the same customizations when it's reloaded once more.  Thank you!

Parents
No Data
Reply
  • 27093
    Verified Answer
    posted

    Hello,

     

    I have been investigating into your requirement, however there doesn’t seem to be such a built-in option. If your goal is to not have to create files I can suggest you save and load the customization to and from a string value like so:

     

    string stringCustomizations;

     

    private void Button_Click_1(object sender, RoutedEventArgs e)

    {

        stringCustomizations = xamDataGrid1.SaveCustomizations();

    }

     

    private void Button_Click(object sender, RoutedEventArgs e)

    {

        xamDataGrid1.LoadCustomizations(stringCustomizations);

    }

     

    Actually you shouldn’t have trouble saving the string to memory stream if that is a need be approach.

     

    Please let me know if you require any further assistance on the matter.

Children