Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
50
Cannot customize serialization of custom ICondition implementation when saving grid configuration
posted

I have a grid with a column that binds to a custom timer object that contains background/foreground color information as well as timer information that is presented in the cell. I also include 2 filters on the column; One shows timers that are currently going off, and the other shows timers that are either ticking or have been acknowledged. My timer class has a boolean property that represents whether or not the timer is going off, so in order to provide this filtering functionality, I had to create an implementation of ICondition that would match this property to either 'True' or 'False'. The problem with that is that when I call SaveCustomization on the grid, the filter gets save in the following format:

<XmlSerializerData Type="Name of Filter Class" Data="PD94bWwgdmVyc2lvbj0iMS4wIj8+A long sequence of characters defining the object" />

This format is not ideal, and I have attempted making that filter class implement IXmlSerializable (I can confirm that the writeXml method gets called in the debugger), but it seems this object is always serialized one extra time and wrapped in this XmlSerializerData class.

So finally my questions are as follows:

1. Is there a way to specify (in the ComparisonCondition) a property on the data object that will be compared with the value in the filter?

2. If this isn't possible and I have to implement ICondition, can I customize how this class is serialized by implementing some kind of interface? Or can I configure the grid itself to serialize this class in a better format?