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
close icon

Kanban with templateselector using MVVM gets System.InvalidOperationException: 'LoadTemplate should not be null'

I have a viewmodel with an observablecollection of Kanban cards bound to my kanban control.  I'm using a templateselector to decide which custom template to display in each column.  When I load the observablecollection with cards in the contructor of the viewmodel, it works great.  However, when I load the observable collection with cards from an async method within the viewmodel, I get the LoadTemplate error.  It doesn't even get far enough to call the OnSelectTemplate method of the templateselector.  When I change from using a templateselector and bind to specific template, it works.

So how can I use a templateselector and load the data after viewmodel initialization?

Sample of template
<ViewCell xmlns="http://xamarin.com/schemas/2014/forms" 
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:d="http://xamarin.com/schemas/2014/forms/design"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:converters="clr-namespace:Wibci.Xamarin.Forms.Converters;assembly=Wibci.Xamarin.Forms.Converters"
             mc:Ignorable="d"
             x:Name="Card"             
             x:Class="Xam1.Features.Home.Templates.PendingCard">
    <Frame Padding="10" HasShadow="true" BackgroundColor="White" CornerRadius="0" >
            <Label Text="Howdy" />        
    </Frame>    
</ViewCell>



3 Replies

DB David Brenchley November 23, 2019 08:01 PM UTC

Attaching one of your samples where I modified to replicate the issue.  Run the attachment, go to the Kanban Customization Tab, then press the Test Button

Attachment: KanbanFailure_fbd43234.zip


RA Rachel A Syncfusion Team November 25, 2019 12:44 PM UTC

Hi David, 
 
Thanks for contacting Syncfusion Support. 
 
We can reproduce the mentioned problem. As we are validating on it, the status will be updated on 27th November 2019. 
 
Thanks, 
Rachel. 



LR Lakshmi Radha Krishnan Syncfusion Team November 28, 2019 02:51 AM UTC

Hi David,

 

We have resolved the reported issue in sample level by setting empty item source collection at load time and set the value to that collection in button click. We have modified the sample, please download it from the following location.

 

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/KanbanCustomizationModified-729624630

 

Please let us know if you need further clarifications on this.

 

Regards,

Lakshmi R.

 


Loader.
Live Chat Icon For mobile
Up arrow icon