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

Column formatting is lost after Serialize/DeSerialize

Thread ID:

Created:

Updated:

Platform:

Replies:

117120 Aug 18,2014 02:06 AM UTC Aug 20,2014 01:51 PM UTC WPF 5
loading
Tags: SfDataGrid
Ruby
Asked On August 18, 2014 02:06 AM UTC

Hi,

I have a text column with the following definition:

                        <syncfusion:GridTextColumn HeaderText="Price"
                                                   MappingName="UnitPrice"
                                                   TextAlignment="Right" 
                                                   DisplayBinding="{Binding Path=UnitPrice, StringFormat='{}{0:C}'}"/>

So, it displays the value as Currency (e.g. $18)
However, after serialize and deserialize the sfdatagrid, the display format is lost that it shows the value as general number only.

Please find the attachment for the project that i produce the issue.


Attachment: SerializationDemo_95782682.rar

Jai Ganesh S [Syncfusion]
Replied On August 18, 2014 10:39 AM UTC

Hi Antony,

 

Thank you for using Syncfusion Products.

We have analyzed your query. You can achieved your requirement by serializing and deserializing the DisplayBinding StringFormat at sample level. In Serialization process, after serializing the grid, then we have serialized the DisplayBinding StringFormat value. In Deserialization process after deserializing the grid, then we have deserialized the DisplayBinding StringFormat. We have prepared a sample based on this. Please find the sample in the following location:

Sample: http://www.syncfusion.com/downloads/support/directtrac/125265/SerializeDisplayBinding-341174490.zip

Please let us know if you need further assistance.

Thank you,

Jai Ganesh S


Ruby
Replied On August 19, 2014 01:38 AM UTC

Hi,

Thank for the quick response.
In fact, our scenario is that:
Our application will serialize the datagrid when it quits.
When it restarts, we want the grid column order, width to be deserialized, but we want the formatting, color, etc to always follow what we defined in the xaml.
For your solution, if our application is updated with a new xaml definition, we will still restore the old formatting setup.

If there is any way to meet the goal?


Jai Ganesh S [Syncfusion]
Replied On August 19, 2014 01:20 PM UTC

Hi Antony,

 

Thank you for the update.

 

We have analyzed your query. You can achieve your requirement by perform the Serialize in “Closing” event and Deserialize in “Loaded” event. We have prepared the sample based on this and please find the sample under the following location.

 

Sample: http://www.syncfusion.com/downloads/support/directtrac/128190/SerializationDemo2101989454.zip

 

Please let us know if you need further assistance.

 

Thank you,

Jai Ganesh S


Ruby
Replied On August 20, 2014 12:57 AM UTC

Hi,

Thank you for the response.
However, it seems that the style I applied to the column hasn't been applied when i restart the application.

From previous example, I understand that I can serialize the column style as well.
However, my problem is that, I want to serialize the column mapping, column width, column order,
but when deserialize, I want to apply the column formatting , style that I defined in the xaml when I restart the application.
(There is a chance that I modified the application and set another style to a column, so I want the style to be shown is the latest one defined in the xaml rather than the serialized one) 


Jai Ganesh S [Syncfusion]
Replied On August 20, 2014 01:51 PM UTC

Hi Antony,

 

Thank you for the update.

 

We have analyzed your query. As of now we don’t have the support to Serialize and Deserialize the Binding that is defined in Columns. And we have already logged the feature request for this. However you can achieve your requirement in sample level and we have prepared the sample based on this and please find the sample under the following location.

 

Sample: http://www.syncfusion.com/downloads/support/directtrac/125265/SerializationDemo1809520802.zip

 

Please let us know if you need further assistance.

 

Thank you,

Jai Ganesh S


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

;