Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4113810
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:22:26+00:00 2026-05-20T22:22:26+00:00

I have a TreeView with a few hundred leaves organized in a few dozen

  • 0

I have a TreeView with a few hundred leaves organized in a few dozen nodes… enough nodes to require scrolling to see them all.

Usually all works fine, but when the expanded nodes would not all fit within the ScrollViewer, clicking on a node to expand it also scrolls the whole TreeView back up to the top (hiding the just-expanded leaves until you scroll back down manually).

This is not the same issue as WPF TreeView with IsVirtualizing="true" jumps around when changing focus and scrolling because a) I’m not setting the vitualizing stack panel options; and b) This is .NET 4 (that link reports the issue only applied to 3.5).

<DataTemplate x:Key="QuestionTemplate">
    <Border BorderBrush="AliceBlue" BorderThickness="1">
        <HeaderedContentControl HeaderTemplate="{DynamicResource QuestionHeaderTemplate}" 
                  Header="{Binding NotifyOnSourceUpdated=True, NotifyOnTargetUpdated=True}" IsTabStop="False" HorizontalAlignment="Left" 
                  IsEnabled="True" />                        
    </Border>
</DataTemplate>
    <HierarchicalDataTemplate x:Key="GroupTemplate" ItemsSource="{Binding MyData, NotifyOnSourceUpdated=True, NotifyOnTargetUpdated=True, Mode=TwoWay}" 
                                          ItemTemplate="{StaticResource MyTemplate}">                
        <Border x:Name="GroupTemplateBorder" BorderBrush="AliceBlue" BorderThickness="1" CornerRadius="10">
        <HeaderedContentControl x:Name="GroupTemplateExpander" MinHeight="22" HeaderTemplate="{DynamicResource GroupHeaderTemplate}" Header="{Binding}" IsTabStop="False" 
            HorizontalAlignment="Left" VerticalContentAlignment="Center" IsEnabled="True" />                   
        </Border>
    </HierarchicalDataTemplate>

    <ScrollViewer HorizontalScrollBarVisibility="Auto">
    <Grid Name="gridPicker" Background="White" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
    <TreeView Name="treeView" MinHeight="20" ItemTemplate="{StaticResource GroupTemplate}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
        <TreeView.ItemContainerStyle>
            <Style TargetType="TreeViewItem">
                <Setter Property="helper:TreeViewNoSelectBehavior.IsTransparent" Value="True" />
            </Style>
        </TreeView.ItemContainerStyle>
    </TreeView>                
    </Grid>
    </ScrollViewer>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T22:22:27+00:00Added an answer on May 20, 2026 at 10:22 pm

    doesn’t the treeview already have a scrollviewer defined inside it’s controltemplate? try removing that scrollviewer and grid and set

    <TreeView Name="treeView" Background="White" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" MinHeight="20" ItemTemplate="{StaticResource GroupTemplate}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
        <TreeView.ItemContainerStyle>
            <Style TargetType="TreeViewItem">
                <Setter Property="helper:TreeViewNoSelectBehavior.IsTransparent" Value="True" />
            </Style>
        </TreeView.ItemContainerStyle>
    </TreeView>             
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a treeview in wpf and I load it ok is all done
I have TreeView control and I want to bind tree nodes' IsExpanded property to
I have a treeview in my C# code. I want to replace all existing
I have TreeView with different level TreeNodes I added same ContextMenuStrip to all parent
I'm new to the Telerik-controls and I have a few questions! First of all,
I have a TreeView control. Say I have 5 nodes in it. On selecting
I have treeview control with one level of parent and child nodes, each node
I have a treeview with nodes like this: Foo (1234), and want to allow
I have a TreeView <asp:TreeView ID=tvCategories runat=server ShowLines=false ShowExpandCollapse=true ExpandDepth=0 /> by default the
I have a treeview which contains, per node, a key and text. However, there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.