Is there a way to prevent focus rectangle from moving when expanding nodes?

7 posts, 0 answers
  1. Chris
    Chris avatar
    30 posts
    Member since:
    Oct 2010

    Posted 14 May 2012 Link to this post

    The RadTreeView seems to move the focus rectangle to child nodes as you expand parent nodes, which is not desirable because in long trees it means that there is a lot of scrolling going on.  

    The attached images show the problem.  I start with a single parent node that has the focus rectangle on it.  As I expand nodes, the focus rectangle gets shifted to the child nodes as they are shown.  I want the focus rectangle to stay with the original node so that there is no scrolling.

  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 15 May 2012 Link to this post

    Hi Chris,

    Can you elaborate on the steps for reproducing this issue. Also, is the RadTreeView databound or declaratively defined? Do you expand it on a button click, with the expander icon or using a custom logic?

    Also can you reproduce it in the sample solution I attached here? If you can, we'd appreciate you sharing your steps and/or sending us a screencast demonstrating these steps.

    We need this additional information as we can't reproduce the issue on our side and your help will allow us to investigate the case further and suggest solutions.

    Kind regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Chris
    Chris avatar
    30 posts
    Member since:
    Oct 2010

    Posted 15 May 2012 Link to this post

    Sorry, I will provide some more details.  The tree is databound to a collection and I've got several levels of HierarchicalDataTemplates.  I'm also using Recycling virtualization and multiple selection mode.  I have IsExpanded and IsSelected databound to properties on viewmodel objects.

    I am expanding the nodes simply by clicking on them.

    The sample that you provided definitely does not exhibit the same behavior.  The focus rectangle actually disappears entirely as I expand the nodes in your sample.

    Any idea on what might cause the focus rectangle to move around by simply expanding them?  I'm not sure that I will be able to create a sample that reproduces the behavior.
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 18 May 2012 Link to this post

    Hi Chris,

    I still can't reproduce the issue and looking at your snapshots I am not sure what is the state of the collapse item - is it focused, focused-notselected... This is why I was wondering if you've applied a custom style or a theme on the RadTreeView?

    I also modified my solution to virtualize the TreeView, I allowed multiple selection and I added bindings to the IsExpanded and IsSelected properties. However the control still behaved as expected on our side. Do you think you can try to recreate the issue in my sample? Or perhaps you can try to strip down your project using the “remove and try” approach - basically removing parts of the code until you find the cause for the problem. Also, it would also help us if you can create a screencast to demonstrate the steps that reproduce the issue.

    We will really appreciate your cooperation on this as we've never encountered such a behavior before and all further information you can give us, may help in finding the cause.

    Kind regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. Chris
    Chris avatar
    30 posts
    Member since:
    Oct 2010

    Posted 18 May 2012 Link to this post

    The only other thing I can think of is that my ViewModels are lazy loading children.  Thus, expanding a Telerik tree node is causing children to be added to the tree at that time.

    I will see if I can come up with a sample that exhibits the behavior.

  7. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 23 May 2012 Link to this post

    Hi Chris,

    I attached another sample solution where the children are loaded on demand. But I still couldn't reproduce the issue. Perhaps you can try to modify this project to reproduce it as it should better illustrate your original application.

    Regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  8. Chris
    Chris avatar
    30 posts
    Member since:
    Oct 2010

    Posted 24 May 2012 Link to this post

    Sorry I haven't posted anything here, but I haven't had a chance to go back and look at this - been busy with other things.

    I'll see if I can get something together to reproduce the issue and I'll post here when I do.
Back to Top
UI for WPF is Visual Studio 2017 Ready