Virtual-TreeView
Virtual-TreeView copied to clipboard
Always select next node upon deletion of the selected node
Could it make sense to always select the next node, if the currently selected one is getting deleted?
If this behavior is too different compared to the current one, we could add a tree option like toSelectNextNodeOnRemval
a tree option is better, somethimes a don't need see more selected nodes. and the selection should stay on same node level.
a tree option+
I like the idea of built-in logic but unfortunately VTV is a tree and there are plenty of cases that not exist in list controls:
- deleting last node (select previous sibling? select previous visible regardless of its level?)
- deleting single node on a level (select next visible regardless of its level? Select next node of the same level? Select parent node?)
- what if a node that is to be selected must not receive focus by app's requirements?
I'm afraid simple cases will be used quite rarely. But - if there will be an option for this, it could help in simple cases.
there are plenty of cases that not exist in list controls
I don't see a problem here. The Windows TreeView common control as used in Windows Explorer gives a good blueprint for the behavior, and users are somewhat used to it.
deleting last node
I would select the previous sibling.
deleting single node on a level
Select parent. This is already implemented in UpdateNextNodeToSelect()
.
what if a node that is to be selected must not receive focus by app's requirements?
I don't see a significant difference to e.g. when user navigates the tree using the cursor keys. There are events that allow to prevent the selection of focusing of a node.
OK then, the feature could be done easily :)
Yes, the remaining question was, if this should be an optional behavior.
Make it optional please, so we're flexible.