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. Image for the cookie policy date

How to save advanced UI filtering user preferences

The great flexibility of SFDataGrid is the Advanced filter UI that provides multiple filter options to filter the data easily directly on UI.
The problem is that on every application start the user need to set again the personalized UI filter if he want the same options setted before exit from the application.
I'd like to know if is there the possibility to save the preferences of UI filtering user filter options on application exit and reload them on the next application start.
Thanks!

3 Replies

SP Sowndaiyan Paulpandi Syncfusion Team August 10, 2016 11:53 AM UTC

Hi Gianni,  
Thanks for contacting Syncfusion Support.  
You can achieve your requirement by using Serialization and Deserialization concept. SfDataGrid allows you to save and load the grid settings using the SfDataGrid.Serialize and SfDataGrid.Deserialize methods. We have prepared a sample as per your requirement and you can download the same from the below location, 
By default, SfDataGrid allows you to Serialize/Deserialize the Sorting, Grouping and Filtering operations. You can serialize the Filtering operation alone by disabling the other operations using SerializationOptions and DeserializationOptions like the below code example.

C# 
For serialize:

var serializationOptions = new SerializationOptions() 
            { 
                SerializeFiltering = true, 
                SerializeCaptionSummary = false, 
                SerializeColumns = false, 
                SerializeDetailsViewDefinition = false, 
                SerializeGrouping = false, 
                SerializeGroupSummaries = false, 
                SerializeSorting = false, 
                SerializeStackedHeaders = false, 
                SerializeTableSummaries = false, 
                SerializeUnBoundRows = false 
            };

For Deserialize :

var deserializationOptions = new DeserializationOptions() 
            { 
                DeserializeFiltering = true, 
                DeserializeCaptionSummary = false, 
                DeserializeColumns = false, 
                DeserializeGrouping = false, 
                DeserializeDetailsViewDefinition = false, 
                DeserializeGroupSummaries = false, 
                DeserializeSorting = false, 
                DeserializeStackedHeaders = false, 
                DeserializeTableSummaries = false, 
                DeserializeUnBoundRows = false 
            };

 
 
You can refer the below UG link to know more about Serialization and Deserialization in SfDataGrid,  
Regards,
Sowndaiyan  



UN Unknown Syncfusion Team August 10, 2016 04:00 PM UTC

Very Great and very simple! It saved me a lot of time!
Very thanks for your great products and wonderful support!


SP Sowndaiyan Paulpandi Syncfusion Team August 11, 2016 09:07 AM UTC

Hi Gianni

Thanks for the update.

Please let us know if you need further assistance. 
Regards, 
Sowndaiyan  


Loader.
Up arrow icon