BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
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.
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
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.