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.
Unfortunately, activation email could not send to your email. Please try again.

Set Item Height of SfTreeNavigator Items To Fit Content

Thread ID:

Created:

Updated:

Platform:

Replies:

115571 Jan 22,2014 06:04 PM Jan 31,2014 07:28 AM WinRT 3
loading
Tags: General
Matt Barnes
Asked On January 22, 2014 06:04 PM

Hi,

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 06:04 AM

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.

 

Regards,

Victory D



TreeNavigator_115571_1da621c5.zip

Matt Barnes
Replied On January 30, 2014 06:34 PM

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"


NavigationMode="Extended"


VerticalAlignment="Top"


HorizontalAlignment="Stretch"


Background="Transparent"


BorderBrush="Transparent"


BorderThickness="0"


ScrollViewer.VerticalScrollMode="Disabled"


Margin="0,0,24,0"


ItemsSource="{Binding Employees}"


<sf:SfTreeNavigator.ItemTemplate>


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


</sf:SfTreeNavigator.ItemTemplate>


</sf:SfTreeNavigator>

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 07:28 AM

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.

Regards,
Suresh B

CONFIRMATION

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.

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.

;