ReoGrid
ReoGrid copied to clipboard
DropdownListCell body type is not serializing/deserializing in any format when saving/loading workbook

Now the interface for saving and loading custom cell body has been added.
The custom cell body data provider can be added or remoted by access the RGFPersistenceProvider.CustomBodyTypeProviders list.
// My custom cell body
class MyCellBody : CellBody
{
}
// The provider used to save and load cell body
class MyCellBodyPersistenceProvider : RGFCustomBodyHandler
{
public object LoadData(Cell cell, string data)
{
return "Loaded";
}
public string SaveData(Cell cell)
{
return "Saved";
}
}
Add custom persistence provider:
RGFPersistenceProvider.CustomBodyTypeProviders.Add(typeof(MyCellBody), "my-cell-body", new MyCellBodyPersistenceProvider());
Test
sheet["A1"] = new MyCellBody();
And save the worksheet as RGF, the data value will be stored as:
<cell row="0" col="0" body-type="my-cell-body">Saved</cell>