C
C#9mo ago
Alex

✅ TreeView scrollbar isn't visible

I have a tree view, and I want it to be scrollable when there are many items. I have tried to put it in the ScrollView and set ScrollViewer.VerticalScrollBarVisibility="Auto" , but it doesn't solve the problem.
No description
6 Replies
Buddy
Buddy9mo ago
Please paste the xaml $paste
MODiX
MODiX9mo ago
If your code is too long, you can post to https://paste.mod.gg/ and copy the link into chat for others to see your shared code!
Alex
AlexOP9mo ago
<StackPanel VerticalAlignment="Stretch">
<Button Command="{s:Action OnLoadAsync}">Load</Button>
<TreeView ScrollViewer.VerticalScrollBarVisibility="Auto" BorderThickness="0" ItemsSource="{Binding Path=Directories}">
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type models:NavigationPaneItem}" ItemsSource="{Binding Children}">
<TextBlock Text="{Binding DisplayName}"/>
</HierarchicalDataTemplate>
</TreeView.Resources>
</TreeView>
</StackPanel>
<StackPanel VerticalAlignment="Stretch">
<Button Command="{s:Action OnLoadAsync}">Load</Button>
<TreeView ScrollViewer.VerticalScrollBarVisibility="Auto" BorderThickness="0" ItemsSource="{Binding Path=Directories}">
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type models:NavigationPaneItem}" ItemsSource="{Binding Children}">
<TextBlock Text="{Binding DisplayName}"/>
</HierarchicalDataTemplate>
</TreeView.Resources>
</TreeView>
</StackPanel>
leowest
leowest9mo ago
dont use stackpanel use a grid stackpanel gives it internally the size it wants is something to do with the stackpanel providing as much height as the inside content wants so the scrollviewer never saw the need to show up and say hi
Alex
AlexOP9mo ago
it solved the problem, thank you
MODiX
MODiX9mo ago
Use the /close command to mark a forum thread as answered
Want results from more Discord servers?
Add your server