Your requirement to
Store/Restore the size and order of the columns will be achievable by using the
Serialization/Deserialization support of our SfDataGrid.
Store / Serialization:
|
using (var file = File.Create("DataGrid.xml"))
{
SerializationOptions options = new SerializationOptions();
options.SerializeColumns = false;
this.sfDataGrid1.Serialize(file, options);
}
|
Restore / Deserialization:
|
using
(var file = File.Open("DataGrid.xml", FileMode.Open))
{
DeserializationOptions options = new DeserializationOptions();
options.DeserializeColumns = false;
this.sfDataGrid1.Deserialize(file, options);
}
|
For more information related to Serialization/Deserialization, please refer to
the below user guide documentation link,
UG
Link:
https://help.syncfusion.com/windowsforms/datagrid/serializationdeserialization#serialization
https://help.syncfusion.com/windowsforms/datagrid/serializationdeserialization#serialize-columns
https://help.syncfusion.com/windowsforms/datagrid/serializationdeserialization#deserialize-columns
If we misunderstood your requirement,
please provide more information regarding the requirement. This would help us
proceed further.
If this post is helpful, please consider Accepting it as the
solution so that other members can locate it more quickly.