Hi all,I have written an application that makes use of the DisplayLayouts' SaveAsXml() and LoadFromXml() functions.Everything works fine until I bind a DataTable (manually constructed) that has column names containing special characters like äöü etc.The LoadFromXml() call fails giving a System.Xml.XmlException: "Invalid character in the given encoding. Line xyz, position xyz."
Is there a way to deal with such column names or anything I can do to make the function work with such DisplayLayouts?Renaming the columns unfortunately isn't an option.
thanks in advance and have a great dayAndy
Hello Andy,
Could you please let me know of your exact version so I can test that in a sample, I am not able to reproduce it right now with 11.2.2050 and 12.1.2008.
Hi Boris,thank you for your quick response, it is very much appreciated.
We are using 11.2.20112.1010, the unsigned, version free assemblies.
Here is a copy of the calls:
using (MemoryStream ms = new MemoryStream(Encoding.Default.GetBytes(_displayLayoutXml))) { try { grdResults.DisplayLayout.LoadFromXml(ms); } catch (Exception ex) { Debug.Print(ex.ToString()); } }
using (MemoryStream ms = new MemoryStream()) { grdResults.DisplayLayout.SaveAsXml(ms); ms.Position = 0; using (StreamReader sr = new StreamReader(ms)) { gridLayoutXml = sr.ReadToEnd(); } } cheersAndy
using (MemoryStream ms = new MemoryStream()) { grdResults.DisplayLayout.SaveAsXml(ms); ms.Position = 0; using (StreamReader sr = new StreamReader(ms)) { gridLayoutXml = sr.ReadToEnd(); } }
cheersAndy