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

Can't focus a treeviewitem by code

2 Answers 66 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Alois
Top achievements
Rank 1
Alois asked on 23 Sep 2011, 03:57 PM
Hi,

I'm using radtreeview with a hierarchical data template, my own treeview style , items template, items container style and items panel.
This works all fine, but I can't set the focus of a treeview item with the following code sequence running in a MouseEnter event:

TreeView.Focus();
Item.Focus();
Item.IsSelected = true;

The Item IsEnabled, IsSelected, IsInView and the parent IsExpanded ... all seems to be prepared for setting the focus - but no success.
Changing the sequence of this calls or using a Dispatcher for the call doen't help either.

Any help appreciated!

Kind regards,
Alois

2 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 28 Sep 2011, 03:28 PM
Hello Alois,

 Can you please first make sure that your style does not have anything in common with this issue? If it doesn't , is it possible for you to send us more from your code so that we could investigate this problem deeper and be better able to advice you ? Thank you for your cooperation in advance. 

Best wishes,
Petar Mladenov
the Telerik team

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

0
Alois
Top achievements
Rank 1
answered on 03 Oct 2011, 12:11 PM
Hello Petar,

thanks for your response!
Recently I did some larger changes to the code so that the upper problem doesn't exist any more.
Nevertheless I will keep an eye on it and come back to you if the problem will arise again.

Thank you so far
Alois
Tags
TreeView
Asked by
Alois
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Alois
Top achievements
Rank 1
Share this question
or