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

Setting Focusable On RadTreeViewItem does not Follow the Default Foucable Behaviour

1 Answer 151 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jawad
Top achievements
Rank 1
Jawad asked on 22 Jul 2013, 11:41 AM

In the Telerik Radtreeview I want some of the treeviewitems to be unSelectable until the previous steps are completed. In the background I have a Boolean property isSelectable which is Binded to the TreeviewItem Focusable Property. Before when I was using the windows TreeView Control this Focusable property made the treeviewitems to be UnSelected until the previous steps were completed which is a default behaviour in windows control. Now after converting to the telerik Radtreeview control I can select items even with focusable property set to false And also the treeviewitem are highlighted on hovering over the item. Is there a way I can make it to work so that on setting the RadTreeviewItem focusable property to false the respective Radtreeviewitems are not selectable and shouldn’t highlight on mouse over as a default Focus Behaviour?  following snippet and the screenshot attached is just an example to demonstrate the issue with the focusable property where even with focusable false category1 can be selected and highlighted.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 24 Jul 2013, 03:41 PM
Hi Jawad,

The RadTreeView selection logic cannot be controlled via the Focusable property. With this property you can disable the Focused visual state of the items but not the selected state.

In order to deny a RadTreeViewItem selection you have to:
  • either bind its IsSelected property and through your ViewModels logic evaluate its value and make sure it doesn't get set to True until the previous steps are implemented
  • or handle the PreviewSelectionChanged event every time that the previous steps aren't implemented. As soon as the Handled property of the event args of the event is set to True, the selection operation is reverted.

If you can elaborate further on your original implementation or send over a sample that demonstrates your original approach, we can modify it (prepare a new sample) to demonstrate one or both of the suggested approaches.

Regards,
Tina Stancheva
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
TreeView
Asked by
Jawad
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or