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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Set Item Height of SfTreeNavigator Items To Fit Content

Thread ID:





115571 Jan 22,2014 11:04 PM UTC Jan 31,2014 12:28 PM UTC WinRT 3
Tags: General
Matt Barnes
Asked On January 22, 2014 11:04 PM UTC


I am working on an app that I am needing to utilise the SfTreeNavigator, but I need the height of the items to fit the contents (2, 3, 4 or sometimes 5 lines of text). I have tried looking in the styles and templates used by the control, but so far setting any of the height, margin or padding properties does not seem to help.

Any idea how I can accomplish this?

Thanks in advance.

Victory Jessie Selvam D [Syncfusion]
Replied On January 23, 2014 11:04 AM UTC

Hi Arjay,


Thanks for using Syncfusion products.


We have prepared a sample and tried to meet your requirement. In the sample, we have set Height="auto" for individual SfTreeNavigator items so that TreeNavigatorItem will occupy the height equal to its content in TreeNavigator.


Please let us know whether the provided sample meets your requirement.



Victory D


Matt Barnes
Replied On January 30, 2014 11:34 PM UTC

Thanks for the sample, it shows that what I am needing to do is possible, however I have tried adapting the sample to work with using templates/bindings and the height doesn't seem to adjust to fit the height of the header.

At the moment, I am using the HierarchicalDataTemplate to be able to have all the SfTreeNavigatorItem items be able to click through and list their children. Using the sample you provided the height was not affected and setting the AccentBrush had no affect. I have included a sample of my current XAML and basic details of the class I am binding to below.

<sf:SfTreeNavigator x:Name="sfTreeNav"









ItemsSource="{Binding Employees}"


<sfprimitives:HierarchicalDataTemplate ItemsSource="{Binding Path=Jobs}" Template="{StaticResource BasicDataTemplate}" />



The class I am binding to is an ObservableCollection with a string and another ObservableCollection as properties.

Suresh B [Syncfusion]
Replied On January 31, 2014 12:28 PM UTC

Hi Arjay,

We are able to reproduce the reported issue 'Set Item Height of SfTreeNavigator Items To Fit Content' and we have logged a bug report. The fix for this issue will be available in our upcoming Release which is scheduled to be released by 27th March 2014. Please visit our website periodically for update regarding releases.
Please let us know if you have any queries.

Suresh B


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon