This is a migrated thread and some comments may be shown as answers.

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

6 Answers 46 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 14 May 2012, 06:24 PM
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.

6 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 15 May 2012, 12:38 PM
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 >>

0
Chris
Top achievements
Rank 1
answered on 15 May 2012, 06:30 PM
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.
0
Tina Stancheva
Telerik team
answered on 18 May 2012, 12:16 PM
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 >>

0
Chris
Top achievements
Rank 1
answered on 18 May 2012, 03:58 PM
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.

0
Tina Stancheva
Telerik team
answered on 23 May 2012, 12:27 PM
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 >>

0
Chris
Top achievements
Rank 1
answered on 24 May 2012, 03:01 PM
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.
Tags
TreeView
Asked by
Chris
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Chris
Top achievements
Rank 1
Share this question
or