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

How to make HeirarchyNavigator refresh when new nodes are added

If the current SelectedItem is a leaf node (ie, the child items ObservableCollection of the selected node is empty), the HeirarchyNavigator correctly shows no children.

If at runtime children are added to this ObservableCollection, I would expect the HeirarchyNavigator to respond to the change and show that there are now children.

If the i click on the root node ("Desktop") and then select "Computer" again, the HeirarchyNavigator displays properly

I'm using a slightly modified version of the WPF control demo application to illustrate this problem.

Syncfusion verion:
Type: Syncfusion.Windows.Tools.Controls.HierarchyNavigator
Assembly: Syncfusion.Tools.Wpf, Version=10.404.0.53, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89
Assembly location: C:\Program Files (x86)\Syncfusion\Essential Studio\\assemblies\4.0\Syncfusion.Tools.Wpf.dll

The relevant Xaml is:

                <syncfusion:HierarchyNavigator Grid.ColumnSpan="2"
                                               IsEnableEditMode="{Binding ElementName=isEnableEditChk,Path=IsChecked}"
                                               ItemsSource="{Binding FileItems}"
                                               IsEnableHistory="{Binding ElementName=isEnableHistoryChk,Path=IsChecked}"                                     
                                               SelectedItem="{Binding SelectedValue,Mode=TwoWay}">
                        <HierarchicalDataTemplate ItemsSource="{Binding FolderItems}">
                            <TextBlock Text="{Binding Content}"
                                       Margin="2,0" />

3 Replies

VR Venkateshwaran Ramdoss Syncfusion Team September 16, 2016 03:20 PM UTC

Hi Sgillbee,

Thank you for contacting Syncfusion Support.

We are unable to reproduce the reported issue at our end. Could you please provide more information about your query by providing the issue reproducing sample? it will helpful us to provide the prompt solution as earlier as possible.

Venkateshwaran V.R.

SG sgillbee September 16, 2016 03:48 PM UTC

1. From the attached sample code project, launch application from bin\Debug\HierarchyNavigator_2008.exe

2. Select "Computer" from the navigator drop-down

3. Notice that the computer collection is empty and there is no menu option for "Computer" in the navigator. This is correct.

4. Click the "Apply Level 2" button on the right. This programmatically adds 4 drive child nodes to the to the Computer node. Notice that there is no menu option next to "Computer" in the navigator even though the child nodes are present.

5. Click "Desktop" in the navigator to return to the root node

6. Pull down the Desktop menu and select "Computer" again.