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

Silverlight RadTreeView Prevent Selection

1 Answer 69 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 05 Jun 2009, 08:10 PM
I am using the RadTreeView in a 2-pane splitter as the primary navigation item for editing items.  In the other pane, I am displaying a Property Grid to edit an item's contents.  When the user attempts to select another treeItem, I want to display a message asking to save.  Depending on the user's response, I want to prevent the RadtreeView from selecting the new item and have it continue to display the prior item as if nothing happened (e.g, the prior item should still be highlighted and focused).  At first, I thought the PreviewSelect and/or PreviewUnselect would do the trick, but they don't seem to work completely. They don't really stop the event chain and things are left in a semi-selected state.  Even though the tree is set up for single select mode, using those events ends up with 2 items selected.  Any suggestions?

1 Answer, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 09 Jun 2009, 02:21 PM
Hi Robert,
What I would suggest is to attach to both PreviewUnselected and PreviewSelected events of RadTreeView and insert the logic that takes care of saving data there (with slight modifications).
For better explanation I have attached a sample project demonstrating your scenario.
The code is pretty self-explanatory, but if you have any questions or comments contact us as soon as possible.

Regards,
Kiril Stanoev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
TreeView
Asked by
Robert
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Share this question
or