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

Serialization of GridTemplateColumn

Thread ID:





123323 Mar 8,2016 11:26 AM UTC Mar 11,2016 04:23 AM UTC WPF 3
Tags: SfDataGrid
Kurt Zimmermann
Asked On March 8, 2016 11:26 AM UTC

I have added a GridTemplateColumn to my DataGrid. Inside the CellTemplate are two Buttons. After serialization and deserialization the Buttons are gone.
I have changed your Serialization sample to demonstrate the Problem - I have added this column:

<syncfusion:GridTemplateColumn HeaderText="Test" MappingName="SupplierID">



<Button Content="{Binding SupplierID}" />




After clicking Serialize and then Deserialize the Buttons are gone.
Is there a way to use der GridTemplateColumn with serialization?



Sowndaiyan Paulpandi [Syncfusion]
Replied On March 9, 2016 01:12 PM UTC

Hi Kurt,

Thanks for contacting Syncfusion Support.

We regret to inform you that in SfDataGrid it is not possible to Serialize GridTemplateColumn. However you can achieve your requirement by manually adding the CellTemplate to the GridTemplateColumn while performing the Deserialization like the below code example. We have prepared a work around sample as per your requirement and you can  download the same from the below location,


static void OnExecuteDeserialize(object sender, ExecutedRoutedEventArgs args)


            var dataGrid = args.Source as SfDataGrid;

            if (dataGrid == null) return;

            var options = args.Parameter as DeserializationOptions;



                using (var file = File.Open("DataGrid.xml", FileMode.Open))


                    dataGrid.Deserialize(file, options);

                    var col = dataGrid.Columns.FirstOrDefault(column => column.MappingName == "SupplierID");

                    col.CellTemplate = App.Current.Resources["TemplateColumn"] as DataTemplate;




            catch (Exception)




Sample :  http://www.syncfusion.com/downloads/support/forum/123323/ze/SerializationDemo-380074400



Kurt Zimmermann
Replied On March 10, 2016 08:11 PM UTC

Thank you for the fast Response - this works perfect!



Srinivasan Vasu [Syncfusion]
Replied On March 11, 2016 04:23 AM UTC

Hi Kurt,

Thanks for the update.

Please let us know if you need further assistance.


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

or the page will be automatically redirected to 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