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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Save grid styles to database

Thread ID:

Created:

Updated:

Platform:

Replies:

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

Hi,

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,

http://www.syncfusion.com/uploads/redirect.aspx?file=sample_240d4fa4.zip&team=development

Thanks,
Fahad

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.

Sample:
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?

Thanks.

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.

Thanks,
Fahad

CONFIRMATION

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.

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

;