protected void tree_ProcessDragNode(object sender, TreeListNodeDragEventArgs e) { string oldPath = e.Node.GetValue(FileManagerHelper.FullPathName).ToString(); //string destination = e.NewParentNode == tree.RootNode // ? FileManagerHelper.RootFolder // : e.NewParentNode.GetValue(FileManagerHelper.FullPathName).ToString(); string destination = e.NewParentNode == tree.RootNode ? FileManagerHelper.CurrentDataFolder : e.NewParentNode.GetValue(FileManagerHelper.FullPathName).ToString(); string newPath = destination + Path.DirectorySeparatorChar + Path.GetFileName(oldPath); FileManagerHelper.MovePath(oldPath, newPath); tree.RefreshVirtualTree(); e.Handled = true; }
protected void tree_NodeUpdating(object sender, ASPxDataUpdatingEventArgs e) { string oldName = ReadName(e.OldValues); string newName = ReadName(e.NewValues); if (oldName == newName) { return; } string key = e.Keys[0].ToString(); TreeListNode node = tree.FindNodeByKeyValue(key); EnsureNode(node); string oldPath = node.GetValue(FileManagerHelper.FullPathName).ToString(); string newPath = Path.GetDirectoryName(oldPath) + Path.DirectorySeparatorChar + newName; FileManagerHelper.MovePath(oldPath, newPath); }