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

Serialization of GridTemplateColumn

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?



3 Replies

SP Sowndaiyan Paulpandi Syncfusion Team 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



KZ Kurt Zimmermann March 10, 2016 08:11 PM UTC

Thank you for the fast Response - this works perfect!



SV Srinivasan Vasu Syncfusion Team March 11, 2016 04:23 AM UTC

Hi Kurt,

Thanks for the update.

Please let us know if you need further assistance.

Live Chat Icon For mobile
Up arrow icon