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

TreeNavigator HierarchicalDataTemplate Template Selector Binding Comes Back Blank

I am trying to build a selector for the TreeNavigator, but when I build the HierarchicalDataTemplate outside of the TreeNavigator all the items come back blank. If I changed the Items to just DataTemplates it works just fine, but when I use HierarchicalDataTemplate it just returns a blank item with nothing in it. I know it is passing the information because I click the item and the SelectionChanged is there, and I know the Template works because it works just fine if I don't use the TemplateSelector.

This is what I do,

    <UserControl.Resources>

        <DataTemplate x:Key="CheckItem">
            <StackPanel Orientation="Horizontal">
                <CheckBox Name="cbItem" VerticalAlignment="Center" Margin="18,0,0,0"/>
                <TextBlock Text="{Binding Path=Header}" VerticalAlignment="Center" Margin="5,0,0,0"/>
            </StackPanel>
        </DataTemplate>


        <sfp:HierarchicalDataTemplate ItemsSource="{Binding Path=Models}" x:Key="ExtendableItem">
            <DataTemplate>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding Path=Header}" VerticalAlignment="Center" Margin="18,0,0,0"/>
                </StackPanel>
            </DataTemplate>
        </sfp:HierarchicalDataTemplate>

        <Classes:DrawerItemSelector x:Key="DrawerItemSelector" CheckableItem="{StaticResource CheckItem}" ExpandableItem="{StaticResource ExtendableItem}"/>

        <Style TargetType="sfn:SfTreeNavigatorItem">
            <Setter Property="Height" Value="53"/>
        </Style>
        <Style TargetType="sfn:TreeNavigatorHeaderItem">
            <Setter Property="Height" Value="50"/>
            <Setter Property="Margin" Value="0,1,0,1"/>
        </Style>

    </UserControl.Resources>

    <sfn:SfTreeNavigator NavigationMode="Extended" ItemsSource="{Binding}" ItemTemplateSelector="{StaticResource DrawerItemSelector}" Name="sftnTree" SelectionChanged="sftnTree_SelectionChanged"/>

Any help would be appreciated.

6 Replies

VV Vignesh V Syncfusion Team November 25, 2013 06:15 PM UTC

Hi Jermey,

Sorry for the delayed response.

We are able to reproduce the problem 'ItemTemplateSelector is not not working in SfTreeNavigator'. We have logged a bug report and fix for this issue will be available in our upcoming 2013 volume 4 release. Please visit our website periodically regarding feature updates.

Please let us know if you have any queries.

Regards,
Vignesh V


JS Jeremy Shore NO LONGER WITH COMPANY November 25, 2013 06:20 PM UTC

Thanks for the response. I look forward to the next release.


JS Jeremy Shore NO LONGER WITH COMPANY November 25, 2013 06:39 PM UTC

According to the Blog the release for Volume 4 is due on December 5th. I kind of need this working for the 2nd. Is there a work around I can use or a file I can update to get this to work?


VV Vignesh V Syncfusion Team November 26, 2013 10:46 AM UTC

Hi Jermey,

 

We regret to let you know that we do not have any workarounds for the issue 'ItemTemplateSelector not working' as this should be fixed at our source level. The fix will be available in our upcoming 2013 Volume 4 release which is scheduled to be rolled out by first week of December 2013.

 

Please let us know if you need any further assistance.

 

Regards,

Vignesh V



JS Jeremy Shore NO LONGER WITH COMPANY December 10, 2013 04:58 PM UTC

Hello, I would like an update on Volume 4. The first week has passed and I haven't seen anywhere where I can get the update, and I really do need this fix. 

Thanks


VV Vignesh V Syncfusion Team December 11, 2013 07:06 AM UTC

Hi Jermey,

Sorry for delay being caused.

We are in the final phase of testing the stability of our release. We are trying our best to have this rolled out by end of this week.

Regards,
Vignesh V

Loader.
Up arrow icon