How can I save column order and sizes ?

This is a .NET MAUI application that uses SfDataGrid.

I let user to drag and resize columns.

How can I store the last column state so that they see the same grid layout when they open the app next time.

I tried to serialise DataGrid.Columns and save into preferences (which seems to work), however deserialisation fails with an error:

Could not create an instance of type Syncfusion.Maui.DataGrid.DataGridColumn. Type is an interface or abstract class and cannot be instantiated. Path '[0].GroupModeProperty', line 1, position 22.

I am using newtonsoft's json serialiser.

What is the recommended way to preserve column states?

Many thanks,

Ali


1 Reply

SD Sethupathy Devarajan Syncfusion Team August 19, 2024 01:33 PM UTC

Hi Ali,

 

Based on provided information, it is clear that you need to save column order and sizes of the DataGrid.

You can achieve this by Serialization and Deserialization. As of now, DataGrid does not have support for serialization and deserialization. We have already considered your request as a feature. We will implement this feature in any of our upcoming releases. At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. We appreciate your patience and understanding until then. You can follow up with the below feedback for further details,

 

Feedback link: 58646

 

Regards,

Sethupathy D.



Loader.
Up arrow icon