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

Exception Thrown when Expanding first level


Hello,

I'm trying to use the SfTreeNvaigator control using the following code:

ObservableCollection<TocItem> tocItems = new ObservableCollection<TocItem>();

for (int i = 1; i < 100;i++ )

{

TocItem tocItem = new TocItem();

tocItem.Name = "TOC " + i.ToString();

tocItems.Add(tocItem);

for (int j=0;j<10;j++)

{

TocItem subTocItem = new TocItem();

subTocItem.Name = "Sub Toc " +i.ToString()+" "+ j.ToString();

tocItem.ChildTocItems.Add(subTocItem);

}

}

treeNavigatorToc.ItemsSource = tocItems;



<Navigation:SfTreeNavigator Name="treeNavigatorToc" NavigationMode="Default" Width="300">

<Navigation:SfTreeNavigator.ItemTemplate>

<primitives:HierarchicalDataTemplate ItemsSource="{Binding ChildTocItems}">

<DataTemplate>

<StackPanel Orientation="Horizontal">

<TextBlock Text="{Binding Name}" VerticalAlignment="Center" Margin="18 0 0 0"/>

</StackPanel>

</DataTemplate>

<primitives:HierarchicalDataTemplate.ItemTemplate>

<primitives:HierarchicalDataTemplate ItemsSource="{Binding ChildTocItems}">

<DataTemplate>

<StackPanel Orientation="Vertical">

<TextBlock Text="{Binding Name}" VerticalAlignment="Center" Margin="18 0 0 0"/>

</StackPanel>

</DataTemplate>

<primitives:HierarchicalDataTemplate.ItemTemplate>

<DataTemplate>

<StackPanel Orientation="Vertical">

<TextBlock Text="{Binding Name}" VerticalAlignment="Center" Margin="18 0 0 0"/>

</StackPanel>

</DataTemplate>

</primitives:HierarchicalDataTemplate.ItemTemplate>

</primitives:HierarchicalDataTemplate>

</primitives:HierarchicalDataTemplate.ItemTemplate>

</primitives:HierarchicalDataTemplate>

</Navigation:SfTreeNavigator.ItemTemplate>

</Navigation:SfTreeNavigator>

The first level of items is displayed but when I click one of the items to expand and show the second level of the hierarchy, the following exception is thrown:
System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
   at Windows.UI.Xaml.Controls.ItemsControl.get_ItemTemplate()
   at Syncfusion.UI.Xaml.Controls.Navigation.SfTreeNavigator.NavigateItem(SfTreeNavigatorItem treeitem)
   at Syncfusion.UI.Xaml.Controls.Navigation.SfTreeNavigator.Select(Object item)
   at Syncfusion.UI.Xaml.Controls.Navigation.SfTreeNavigator.OnSelectionChanged(DependencyPropertyChangedEventArgs args)
   at Syncfusion.UI.Xa

What am I doing wrong?

5 Replies

MS Mariappan S Syncfusion Team November 16, 2015 09:44 AM UTC

Hi Stergios,

Thank you for contacting Syncfusion support.

We have prepared sample by using your code snippets and we have checked the reported issue in this sample. But we are unable to reproduce the reported issue in this sample.

Please download the sample from the below link.

Sample link: SfTreeViewNavigatorSample


Please have a look at the sample and if the issue still exists, could you please try reproducing it in the above sample or send reproducible sample and the reproducing steps. so that we could sort out the cause of the issue and provide you the solution?

Regards,
Mariappan S.


ST Stergios November 17, 2015 08:59 PM UTC

Hello and thank you for your support.

I have reproduced the issue by replacing the references Syncfusion.SfShared.WinRT and Syncfusion.SfTreeNavigator.WinRT (I couldn't find the dolls anyway)  by Syncfusion 8.1 controls for WinRT XAML, Version=13.3.0.12. I am attaching the modified sample.

Kind Regards,

Stergios

Attachment: SfTreeViewNavigatorSample_860c26aa.zip


SM Sugapriya Mariappan Syncfusion Team November 18, 2015 10:19 AM UTC

Hi Stergios,

We have checked our last updated sample with the product version 13.3.0.12.But we are still unable to reproduce the reported issue at our end. We have also taken a video which demonstrates our replication steps

Please find the video from the below link
Video link:video

Could you please check the attached video and let us know whether we have followed correct issue reproducing steps or not? If not, kindly share us more information by providing issue reproducing steps. This would help us to proceed further on this

Please let us know if you need any other assistance

Regards,
M.Sugapriya


ST Stergios November 18, 2015 07:22 PM UTC

Hi,

Please see the attached video that shows the problem. I have used the exact example that I attached to my previous reply.

Is it possible that the problem is related to the environment? I'm using VS Ultimate 2013 (12.0.40629.00 Update 5) on Windows 10.  

Regards,

Stergios

Attachment: record_31f105a1.zip


SM Sugapriya Mariappan Syncfusion Team November 19, 2015 11:46 AM UTC

Hi Stergios,

Currently we are preparing an environment which you mentioned in your last update. Could you please let us know whether you are facing the reported issue only in your machine or all other machines? Also please share us more information about the reported issue which would help us to reproduce from our side.

Regards,
M.Sugapriya

Loader.
Live Chat Icon For mobile
Up arrow icon