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

LoadTemplate should not be null

I am getting the error mentioned above when I try to implement a data template selector on the sfRotator control. 

Running on Visual Studio Enterprise 2019
Syncfusion control version


            <DataTemplate x:Key="SampleTemplateTextLine">
                        Columns="{Binding Columns}" />

            <DataTemplate x:Key="SampleTemplateEmptyLine">

            <local:SampleTemplateSelector x:Key="SampleTemplateSelector"
                SampleTemplateTextLine="{StaticResource SampleTemplateTextLine}"
                SampleTemplateEmptyLine="{StaticResource SampleTemplateEmptyLine}" />

                ItemsSource="{Binding SampleList}"
                ItemTemplate="{StaticResource SampleTemplateSelector}">

3 Replies

MK Muneesh Kumar G Syncfusion Team July 4, 2019 06:03 AM UTC

Hi Liam, 
Greetings from Syncfusion.  
We have analyzed your query and we would like to inform you that this problem has been fixed in our latest Vol 2 Beta release ( Please upgrade our version to resolve this problem.  
Before update to Beta version, please follow steps mentioned in below link to clear old nuget cache.   
Muneesh Kumar G.    

LK Liam Keogh July 4, 2019 09:44 AM UTC

Hi Muneesh, unfortunately updating to version 17.2.28-beta introduces a NullReferenceException.

System.NullReferenceException: Object reference not set to an instance of an object.
at Syncfusion.SfRotator.XForms.Droid.SfRotatorRenderer.GetViewTemplateFromTemplate (Xamarin.Forms.DataTemplate template, System.Int32 index, Xamarin.Forms.Rectangle size, Syncfusion.SfRotator.XForms.SfRotator _rotator)

Can you confirm if this has anything to do with my Xamarin.Forms version or not?

MK Muneesh Kumar G Syncfusion Team July 4, 2019 10:22 AM UTC

Hi Liam,  
We have analyzed your code snippet and we found that the reported problem occurs due to using the ViewCell in DataTemplate.  
You can resolve this problem by using TextLine directly without ViewCell in DataTemplate.  
Muneesh Kumar G.  

Live Chat Icon For mobile
Up arrow icon