Would like to know if I am the error or I have encountered a bug.
I have a grid with parents and children. I have made buttons to move the nodes from top to bottom and back. This works, but the first selected node remains selected. The node that should be moved can be moved as desired. Why is the first selected node still displayed?
private void IDC_ARROW_UP_Click(object sender, System.EventArgs e)
{
foreach (Infragistics.Win.UltraWinTree.UltraTreeNode Node in this.uTreeMenue.SelectedNodes)
{
Node.Reposition(Node, Infragistics.Win.UltraWinTree.NodePosition.Previous);
Node.Selected = true;
}
}
Selected node is shown below:
---EDIT:
private void IDC_ARROW_UP_Click(object sender, System.EventArgs e)
{
var NodeSelected = uTreeMenue.SelectedNodes;
var NodeCount = NodeSelected.Count;
NodeSelected.SortByPosition();
if (NodeCount > 0 && NodeSelected[0].PrevVisibleNode is Infragistics.Win.UltraWinTree.UltraTreeNode Node)
Node.Reposition(NodeSelected[NodeCount - 1], Infragistics.Win.UltraWinTree.NodePosition.Next);
}
---Same for the Down_Click_Method

Try the code below:
The logic implemented in the code above is very simple. Instead of moving all selected nodes (for example
Canada…Franceon the picture below) up the first node located before all the selected items moving after all selected items down:Therefore, after moving the node preceding all selected items down (in the test example this is
Brazilitem) theUltraTreecontrol will be look like below:To determine limits of the selected items correctly they are should be sorted by using the
SortByPosition()method, that sorts theSelectedNodescollection such that members appear in the same order they do in the tree.