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. Image for the cookie policy date

Column formatting is lost after Serialize/DeSerialize

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

5 Replies

JG Jai Ganesh S Syncfusion Team 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



RU Ruby 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?



JG Jai Ganesh S Syncfusion Team 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



RU Ruby 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) 



JG Jai Ganesh S Syncfusion Team 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


Loader.
Live Chat Icon For mobile
Up arrow icon