We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Save grid styles to database

Thread ID:





93690 Mar 29,2010 06:26 PM UTC Mar 31,2010 05:22 PM UTC WPF 3
Tags: GridControl
Joe Ward
Asked On March 29, 2010 06:26 PM UTC


We're looking to save grid style information to our central database so that it can be repopulated on other computers when they grab the grid style data from the database.

Our plan is to save each cell style individually, using GridStyleInfo, and load up all cell style data from the database and apply it to our grid. We've run into some issues trying to serialize to binary and XML, as well as even trying to use XamlWriter and XamlReader on the GridStyleInfo object.

What would be the best way to save the GridStyleInfo properties?

Thanks in advance.

Mohamed Suhaib Fahad A. [Syncfusion]
Replied On March 30, 2010 09:52 AM UTC

Hi Joe,

You can use the XmlSerialize to serialize and deserialize the grid styles, the styles should be converted to a serlizable list, Please check the below sample that shows serialization, likewise you can de-serialize and populate the grid.Model again,



Joe Ward
Replied On March 30, 2010 02:57 PM UTC

Thanks. I'm looking to save each cell style individually. The sample app appears to save them all together.

The app helped me out by pointing me to the GridStyleInfoStore object. It has a WriteXml function, but I'm having some issues with it. When I go to use the GridStyleInfoStore.ReadXml function, it complains that there is more than one root element in the XML, which there is. It looks to be taking the properties I've changed, but not putting them under a root element. I see CellValue, Background and Tag, all three of which I set.

http://www.w3.org/2001/XMLSchema" d2p1:type="q1:string" xmlns:d2p1="http://www.w3.org/2001/XMLSchema-instance">qwertySystem.Windows.Media.ImageBrush xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="ImageBrush">1System.Windows.Media.ImageBrushDAI.UI.Office.Interfaces.Compliance.TemplateDesigner.CellTypeNonEditable'>http://www.w3.org/2001/XMLSchema-instance">NonEditable

Is there some workaround so that I can save each cell style as it's own independent xml to be serialized to the database?


Mohamed Suhaib Fahad A. [Syncfusion]
Replied On March 31, 2010 05:22 PM UTC

Hi Joe,

That is a bug we had before and we fixed it now, Can you please create a Direct trac incident so that we can follow up with the fix. Also, use the forum link as the title of your incident.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon