preserve Cell, Row and Column TAGS during Save and Load
CanadianHusky opened this issue · 0 comments
Describe the feature
Currently worksheet.Save and .Load methods with FileFormat.ReoGridFormat save and load worksheet data in XML format.
The xml contains additional data about row/column size and borders etc.
Would it be possible to include Cell, Row and Column TAG object serialization into the RGF Format and preserve all object tags during Load and Save operation ?
In my scenario the tags will contain certain business objects which are not represented visually, but are needed for the functionality.
I would imagine the following options and functionality:
- enable/disable Save with Tags.
- during Save, if a Cell, Row or Column has Tag Object defined, Call a delegate function to Serialize Tag to XML String
- Implement default .Net XMLSerializer as standard
https://learn.microsoft.com/en-us/dotnet/api/system.xml.serialization.xmlserializer?view=netframework-4.6.2 - allow installing custom Delegate Function for Serialization : Input = Object of Type T, Output = XML String. So Users can implement their own Serialization Logic, even with a JSON Serializer if they want.
Public Delegate Function TagSerializer(Of T)(input As T) As String
Public Delegate Function TagDeSerializer(Of T)(xmlstring As String) As T
all the Grid Save/Load functions would do is check if a Tag objects exists, and if it does pass in the Object to the Serializer Delegate, get a string back and write that as an XML Attribute. What the serialized content is does not matter. The user function would be responsible for deserialization. So even a JSON String could be used which is leaner than XML
In the generated XML it could look like this
<cells>
<cell row="0" col="0" tag="xml or json string for cell tag">Test1</cell>
</cells>
same for rows and columns
<rows>
<row row="4" height="52" last-height="20" auto-height="false" tag="xmlstring" />
</rows>
<cols>
<col col="1" width="128" last-width="70" tag="xmlstring"/>
</cols>
Which edition of ReoGrid is targeted
- Windows Form
The control is brilliant and a hidden gem.
Thank you for the great work and Best Regards