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

SelectedItem binding

1 Answer 49 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Miłosz Cechnicki
Top achievements
Rank 1
Miłosz Cechnicki asked on 05 Jul 2012, 09:52 AM
Hi,

I encountered an problem with setting SelectedItem from ViewModel.

It occurs when I'm adding and/or removing an item from TreeView. After that action I force the SelectedItem to be set to actually added item, or the item following deleted one.
Everything seems to be ok, but as You can see at attached screenshot, the item I'm trying to select is red one, but around other item (when adding the one, that was previously selected, when deleting - it seems it's a random element) is a light selection.
And then it works as follows:
1. When performing any action on "SelectedItem" - the action is performed on red item.
2. When moving selection using up/down keys - next selected item is above/belowe the item with light selection.

It's a bit confusing for users, who operate with keybord, e.g. removing some item...

1 Answer, 1 is accepted

Sort by
0
Accepted
Hristo
Telerik team
answered on 10 Jul 2012, 06:41 AM
Hello Milosz,

The "light selection" as you call it, is actually a visual indication for the focused element. Every keyboard operation is done in relation to the focused element. Thus using up/down arrows, editing, expanding and collapsing the item via the keyboard is done on the focused item.
When selecting the item you could also focus it by calling Focus() method on the appropriate RadTreeViewItem.

Greetings,
Hristo
the Telerik team

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

Tags
TreeView
Asked by
Miłosz Cechnicki
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or