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

RadTreeViewItem.Command does not fire after another item is programmatically set as selected

1 Answer 53 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ricky
Top achievements
Rank 1
Ricky asked on 04 Dec 2012, 06:01 PM
I have a set of tabbed views that correspond to RadTreeViewItems so that when the treeViewItem is clicked, the correct tab is selected and when a different tab is clicked, the correct treeViewItem is selected.  I am binding to the RadTreeViewItem.Command property so that I am notified when the user clicks on the treeViewItem..

The problem is that programmatically changing the IsSelected property of a treeViewItem does not "reset the active" treeViewItem, meaning that the original treeVIewItem will not fire its Command when the user clicks on it.  Visually, everything looks correct, but I don't know how to notify the treeview that I programmatically changed the active treeViewItem.

Example, the user clicks on treeViewItem1 --> treeViewItem1 highlights and then highlights tab1.  The user then selects tab2 --> tab2 highlights and treeViewItem2.IsSelected is set to true.  When the user clicks back on treeViewItem1, its Command is not fired. 

Additionally, I do not want the treeViewItem that is programmatically set as IsSelected to fire its Command.  That would cause in infinite loop in my current code.

1 Answer, 1 is accepted

Sort by
0
Ricky
Top achievements
Rank 1
answered on 06 Dec 2012, 10:59 PM
Working with a group of programmers in a scrum team is FUN!  It seems that some other code was setting the IsEnabled flag to false but the GUI item was not grayed out so I did not know it was disabled.
Tags
TreeView
Asked by
Ricky
Top achievements
Rank 1
Answers by
Ricky
Top achievements
Rank 1
Share this question
or