Preventing the root node to be selected when deleting a child node

Grids for WPF Forum

Posted 2 months ago by Daniel Constantin - ModuleWorks GmbH
Version: 25.1.1
Avatar

How can I prevent the parent node or other node of a grids:TreeListBox to be selected when I delete a child node ?

I have set up a scroll into view for the selected node but when I delete a child node it will select the root node and it will scroll into view for that node which I do not want.

Kind regards,

Daniel

Comments (4)

Posted 2 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Daniel,

The selection should only be moved if a node being removed was selected.  I just retested that here and it seemed fine, where I could remove a child node with the parent selected, and the parent remained selected.

If your node to remove is selected, you could select another node prior to the remove call to make sure the selection appears where you want.


Actipro Software Support

Posted 2 months ago by Daniel Constantin - ModuleWorks GmbH
Avatar

Hi!

The logic might be a bit too complex. I would need to find the above sibling somehow.

In my case the item / items will be selected before I remove it / them.

Cant I just stop somehow this automatic selection ?

Kind regards,
Daniel

Answer - Posted 2 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Daniel,

We have updated the logic for the next build to select the previous sibling, falling back to the parent if there is none.


Actipro Software Support

Posted 2 months ago by Daniel Constantin - ModuleWorks GmbH
Avatar

Thank you!

The latest build of this product (v25.1.2) was released 25 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.