protected void tree_VirtualModeNodeCreating(object sender, TreeListVirtualModeNodeCreatingEventArgs e) { string nodePath = e.NodeObject.ToString(); e.NodeKeyValue = FileManagerHelper.GetPathKey(nodePath); e.IsLeaf = !Directory.Exists(nodePath) || (Directory.GetFiles(nodePath).Length < 1 && Directory.GetDirectories(nodePath).Length < 1); e.SetNodeValue(FileManagerHelper.FullPathName, nodePath); e.SetNodeValue(FileManagerHelper.NameFieldName, Path.GetFileName(nodePath)); }
void FocusByPath(string name) { string key = FileManagerHelper.GetPathKey(name).ToString(); TreeListNode node = tree.FindNodeByKeyValue(key); if (node == null) { return; } node.Focus(); }