Serialization: The problem of working XMLSerializer with GridGroupingControl

Our team are evaluating your grid and I use the following code to see if GridGroupingControl could be serialized via XMLSerializer:

XmlSerializer xs = new XmlSerializer(typeof(GridGroupingControl));
StreamWriter myWriter = new StreamWriter(Server.MapPath("Grid1_Properties.xml"));
ASPxGrid grid = new ASPxGrid();
xs.Serialize(myWriter, GridGroupingControl1);
myWriter.Close();

However, it fails. A exception is thrown whose message indicates that EnableTheming has existed in the namespace (this message is translated from my native language; my IDE mixes English with my native language and I don't know why)

So how to I solve it? We hope each UI controls we adopt can be serialized via XmlSerializer since it is a standard .NET component.

Thanks in advance.
Ricky

4 Replies

RI Ricky June 5, 2007 01:53 AM UTC

Please ignore the irrelevant line "ASPxGrid grid = new ASPxGrid();" in the code snippet.

Ricky.

>Our team are evaluating your grid and I use the following code to see if GridGroupingControl could be serialized via XMLSerializer:

XmlSerializer xs = new XmlSerializer(typeof(GridGroupingControl));
StreamWriter myWriter = new StreamWriter(Server.MapPath("Grid1_Properties.xml"));
ASPxGrid grid = new ASPxGrid();
xs.Serialize(myWriter, GridGroupingControl1);
myWriter.Close();

However, it fails. A exception is thrown whose message indicates that EnableTheming has existed in the namespace (this message is translated from my native language; my IDE mixes English with my native language and I don't know why)

So how to I solve it? We hope each UI controls we adopt can be serialized via XmlSerializer since it is a standard .NET component.

Thanks in advance.
Ricky


VA Valli Syncfusion Team June 5, 2007 01:03 PM UTC

Hi Ricky,

Thank you for evaluating our Grid control.

We are currently working on our requirement and will update you within '2' days.

Regards,
Valli


RI Ricky June 6, 2007 12:32 AM UTC

Thanks a million.
Ricky.

>Hi Ricky,

Thank you for evaluating our Grid control.

We are currently working on our requirement and will update you within '2' days.

Regards,
Valli


RR Ramya R Syncfusion Team June 19, 2007 01:16 PM UTC

Hi Ricky,

We strongly apologize for this long delay in getting back to you.

I was not able to reproduce the issue that you have mentioned here.

When I use the coding provided by you, I get a exception as follows,

System.InvalidOperationException was unhandled by user code
Message="There was an error reflecting type 'Syncfusion.Web.UI.WebControls.Grid.Grouping.GridGroupingControl'."

Generally XML Serializer cannot be used to serialize a class which uses SortedList. Since our GridGroupingControl uses SortedList it is not serializable using XmlSerializer and it throws the above mentioned exception,

But you can serialize the Engine,LookAndFeel of the GridGroupingControl.

The Engine of the GridGroupingControl can be serialized as shown in the code snippet below,

string st = Server.MapPath(string.Empty) + "\\App_Data\\Serialization.xml";
XmlTextWriter xw = new XmlTextWriter(st, System.Text.Encoding.UTF8)
xw.Formatting = System.Xml.Formatting.Indented;
this.GridGroupingControl1.WriteXmlSchema(xw);
xw.Close();

Could you please let us know what part(ie. whether the Engine or LookAndFeel or etc..) of GridGroupingControl that you wish to serialize, so that it would help us in meeting your requirement?

Please let me know if you have any queries.

Thanks & Regards,
Ramya.

Loader.
Up arrow icon