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

SfAccordion converter error

Hi,

If I use datacontext in page like this:

namespace SfAccordionSample
{
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();
            this.DataContext = new MyViewModel();
        }
    }

    public class MyViewModel
    {
        public string MyText { get; set; }
    }
}
XAML:
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:layout="using:Syncfusion.UI.Xaml.Controls.Layout"
    x:Class="SfAccordionSample.MainPage"
    mc:Ignorable="d">

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <TextBox Text="{Binding MyText}" Width="200" Margin="20"></TextBox>
    
        <layout:SfAccordion HorizontalAlignment="Center" VerticalAlignment="Center" Height="500" Width="500">
            <layout:SfAccordionItem Header="WinRT" Content="WinRT"/>
            <layout:SfAccordionItem Header="Windows Phone" Content="Windows Phone"/>
            <layout:SfAccordionItem Header="WPF" Content="WPF"/>
            <layout:SfAccordionItem Header="Silverlight" Content="Silverlight"/>
        </layout:SfAccordion>
    </Grid>
</Page>

I get this errors:
Error: Converter failed to convert value of type 'SfAccordionSample.MyViewModel' to type 'DataTemplate'; BindingExpression: Path='' DataItem='SfAccordionSample.MyViewModel'; target element is 'Syncfusion.UI.Xaml.Controls.Layout.SfAccordionItem' (Name='null'); target property is 'ContentTemplate' (type 'DataTemplate'). 
Error: Converter failed to convert value of type 'SfAccordionSample.MyViewModel' to type 'DataTemplate'; BindingExpression: Path='' DataItem='SfAccordionSample.MyViewModel'; target element is 'Syncfusion.UI.Xaml.Controls.Layout.SfAccordionItem' (Name='null'); target property is 'HeaderTemplate' (type 'DataTemplate'). 

What I am doing wrong, or this is a bug?

Thanks,
Radim

1 Reply

VR Vijayalakshmi Roopkumar Syncfusion Team November 23, 2016 07:09 AM UTC

Hi Radim,

We were able to reproduce the reported issue with SfAccordion and have logged a defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents 

Regards,
Vijayalakshmi V.R. 


Loader.
Live Chat Icon For mobile
Up arrow icon