c# DevExpress.XtraTreeList 樹形節點的上下移動
private void btnMoveUp_Click(object sender, EventArgs e)
{
this.treeFile.Columns["LastWriteTime"].SortOrder = SortOrder.None;
TreeListNode FocuesNode = this.treeFile.FocusedNode;
treeFile.BeginUpdate();
int PrevNodeIndex = this.treeFile.GetNodeIndex(FocuesNode.PrevNode);
treeFile.SetNodeIndex(FocuesNode, PrevNodeIndex);
treeFile.EndUpdate();
}
//向下
private void btnMoveDown_Click(object sender, EventArgs e)
{
this.treeFile.Columns["LastWriteTime"].SortOrder = SortOrder.None;
TreeListNode FocuesNode = this.treeFile.FocusedNode;
treeFile.BeginUpdate();
int PrevNodeIndex = this.treeFile.GetNodeIndex(FocuesNode.NextNode);
treeFile.SetNodeIndex(FocuesNode, PrevNodeIndex);
treeFile.EndUpdate();
}