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

[Bug] Using a DataTemplate for a GridTemplateColumn

Hi,

I'd like to set a global CellTemplate, which I use for a GridTemplateColumn.

I defined the following DataTemplate in my App.xaml:
<DataTemplate x:Key="myCell">
<Label Text="{Binding}"/>
</DataTemplate>

But if I use this DataTemplate in a GridTemplateColumn as CellTemplate, the binding won't work:
<syncfusion:GridTemplateColumn MappingName="name" HeaderText="Name" CellTemplate="{StaticResource myCell}"/>

If I set the binding in the DataTemplate to {Binding name}, I get the property. But I'd like to use the datatemplate dynamically.
Even if I set the BindingContext="{Binding name}" for the GridTemplateColumn, I won't get any result.

Any ideas on how to solve this issue?
Thanks!

1 Reply

VP Vimal Prabhu Manohkaran Syncfusion Team April 25, 2016 12:59 PM UTC

Hi John,

Thanks for contacting Syncfusion support.

Currently we dont have support for reusing same data template for multiple columns. However we have logged a feature request for the same and it can be expected to roll out in any of our upcoming releases .

Regards,
Vimal Prabhu 


Loader.
Up arrow icon