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

Template Column doesn't work in Version

Thread ID:





128314 Jan 13,2017 11:56 AM UTC Jan 16,2017 10:06 AM UTC UWP 3
Tags: SfDataGrid
Alexander Sobotta
Asked On January 13, 2017 11:56 AM UTC


I updated Syncfusion UWP from to

Now i get this error message when running the app: Cannot add instance of type 'Syncfusion.UI.Xaml.Grid.GridTemplateColumn' to a collection of type 'Syncfusion.UI.Xaml.Grid.Columns

Why insctance of a TemplateColumn cannot be added to the Columns of the Grid? 
Here's the code of my Template Column:

                         <Image Source="{Binding ImagePreview, Converter={StaticResource ResourceKey=ByteArrayToImageConverter}}"/>

When i roll back to it works fine. 


Farjana Parveen Ayubb [Syncfusion]
Replied On January 16, 2017 08:57 AM UTC

Hi Alexander, 

Thank you for contacting Syncfusion support. 
We have checked the reported issue ”TemplateColumn is not loaded in SfDataGrid in Syncfusion version”,  by binding the BitmapImage as a Source for Image in TemplateColumn, but we are unable to reproduce the issue at our end. Could you please share the ByteArrayImageConverter code and ByteArray code which is bounded in ViewModel, otherwise could you please modify the below sample which will help us to provide you the better solution. 
Please refer the sample in the below link that we have tried in our end. 
Sample Location: UWP_TemplateColumn_Sample
Farjana Parveen A 

Alexander Sobotta
Replied On January 16, 2017 09:40 AM UTC


Thank you for the sample application, it helped me to find the error.

In your sample application you have set "MappingName" at the templatecolumn. 
I thaught it's not nessecary to set a mappingname because the binding inside defines it and in that was working. 
What if I want to set more that one binding inside the template column? What is the correct MappingName then?

This is the working code with now, defining "ImagePreview" two times:

                <SfGrid:GridTemplateColumn HeaderText="Preview" MappingName="ImagePreview" AllowFiltering="False" AllowSorting="False" AllowGrouping="False">
                            <Image Source="{Binding ImagePreview, Converter={StaticResource ResourceKey=ByteArrayToImageConverter}}"/>



Sivakumar R [Syncfusion]
Replied On January 16, 2017 10:06 AM UTC

Hi Alexander, 
Yes, You have to set MappingName to the column. It is mandatory. You can set MappingName as any property in underlying data object. Based on the MappingName property of column data operations like sorting, grouping and filtering will be performed. 
It will also bind template based on MappingName of the column. Refer the below documentation link for more information, 


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

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