Skip to content

Move Nodes

David West edited this page Aug 29, 2016 · 3 revisions

< Add New Nodes

Move Current Node To Another Parent

public virtual void MoveToParent(TId parentId, int? insertIndex = null)

The first parameter identifies the target parent by entity id.

The second, optional parameter allows the moving node to be inserted at a particular child order index. If it is specified and greater than the current number of children, the node is added as the last child.

Move Current Node to an Adjacent Position

public virtual void MoveToAdjacentPosition(TId targetId, Adjacency adjacency)

The first parameter identifies the target node by entity id.

The following shortcut methods exist:

void MoveToPositionBefore(TId targetId)
void MoveToPositionAfter(TId targetId)

There are two additional methods that can make it even easier to move a node among its current siblings:

public virtual void IncrementSiblingPosition()
public virtual void DecrementSiblingPosition()

Detach & Attach Nodes >

Clone this wiki locally