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

AllowRemove some and not others

2 Answers 37 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Travis
Top achievements
Rank 1
Travis asked on 10 Jun 2013, 01:05 AM
Hello,

I need to find a way to intercept an event, key press, or something. I need to be able delete some nodes in a RadTreeView, but not others. Some nodes are parent "static" nodes (i.e. node analogs to a List<Object>), whereas other nodes are non-static, the Object values themselves.

I'd like to delete the non-static children, and not delete the static ones, during normal "casual" operation. That is, the user is navigating and casually pressed Delete to delete a node.

The poor man's way of doing it will probably work: hook up some context menus, that sort of thing.

Is there a BeforeRemove type event, or otherwise an event that allows me to check and flag a Cancel?

Thank you...

2 Answers, 1 is accepted

Sort by
0
Travis
Top achievements
Rank 1
answered on 11 Jun 2013, 07:45 PM
I believe I found a suitable workaround. If we set AllowRemove = false, then handle the KeyUp (with additional SelectedNodes and/or SelectedNode) and NodeRemoved events, that will do the trick. It's a little more work but not terrible when we specialize the RadTreeView and RadTreeNodes within our application view layers.
0
Paul
Telerik team
answered on 12 Jun 2013, 02:53 PM
Hi Michael,

Thank you for writing.

I am glad to hear that you have found solution for your issue. We will introduce a new event in future release - NodeRemoving, but it has not been implemented yet. Please feel free to visit the page in our Public Issue Tracking System and add your vote: http://www.telerik.com/support/pits.aspx#/details/Issue=10268

Please let us know if you need any further assistance.

Regards,
Paul
Telerik
RadChart for WinForms is obsolete. Now what?
Tags
Treeview
Asked by
Travis
Top achievements
Rank 1
Answers by
Travis
Top achievements
Rank 1
Paul
Telerik team
Share this question
or