We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Can i save and load selected column from database for ColumnChooser feature?

Thread ID:





133056 Oct 6,2017 07:07 AM UTC Oct 9,2017 03:59 PM UTC WPF 1
Tags: SfDataGrid
Asked On October 6, 2017 07:07 AM UTC


Can i know how can i save and load the selected column preference when using ColumnChooser feature?

Lets say, the first time loaded, i have 3 columns displayed. user added 5 additional columns. i would like to do a save to database for this user, so the next time the user comes back to this screen, he will see 8 columns in total.

Is this feature supported?


Gnanasownthari Thirugnanam [Syncfusion]
Replied On October 9, 2017 03:59 PM UTC


You can save the state of SfDataGrid using serialization and deserialization. 

private void Searilize(object sender, RoutedEventArgs e) 
    using (var file = File.Create("SfDataGrid.xml")) 
        //Serialize the file. 
private void Deserialize(object sender, RoutedEventArgs e) 
    using (var file = File.Open("SfDataGrid.xml", FileMode.Open)) 
        //Deserialize the file 

Now we have prepared the sample by adding columns from column chooser and save the state by using serialization and deserialization while move to next page and come back to the same screen based on your requirement, you can download the same from below mentioned location. 

Sample location. 

Please refer the below UG link for more details about serialization and deserialization. 

Gnanasownthari T. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon