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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

LoadTemplate should not be null

Thread ID:

Created:

Updated:

Platform:

Replies:

145688 Jul 3,2019 03:35 PM UTC Jul 4,2019 10:22 AM UTC Xamarin.Forms 3
loading
Tags: SfRotator
Liam Keogh
Asked On July 3, 2019 03:35 PM UTC

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 17.1.0.47

        <ResourceDictionary>

            <DataTemplate x:Key="SampleTemplateTextLine">
                <ViewCell>
                    <local:TextLine
                        HorizontalOptions="FillAndExpand"
                        Columns="{Binding Columns}" />
                </ViewCell>
            </DataTemplate>

            <DataTemplate x:Key="SampleTemplateEmptyLine">
                <ViewCell>
                    <BoxView
                        BackgroundColor="Transparent"
                        HorizontalOptions="FillAndExpand"
                        HeightRequest="10"/>
                </ViewCell>
            </DataTemplate>

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

            <sfRotator:SfRotator
                HorizontalOptions="FillAndExpand"
                VerticalOptions="FillAndExpand"
                NavigationStripMode="Dots"
                NavigationDirection="Horizontal"
                ItemsSource="{Binding SampleList}"
                ItemTemplate="{StaticResource SampleTemplateSelector}">
            </sfRotator:SfRotator>

Muneesh Kumar G [Syncfusion]
Replied On 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 (17.2.0.28). 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.   
  
 
Regards, 
Muneesh Kumar G.    


Liam Keogh
Replied On July 4, 2019 09:44 AM UTC

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

UNHANDLED EXCEPTION:
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?


Muneesh Kumar G [Syncfusion]
Replied On 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.  
  
Regards,  
Muneesh Kumar G.  


CONFIRMATION

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

Live Chat Icon For mobile
Live Chat Icon