private void beforeNodeExpand(object sender, BeforeExpandEventArgs e) { if (!e.CanExpand) { return; } if (!UseLazyLoading) { return; } var nodeToExpand = NodeFrom(e.Node); foreach (var child in nodeToExpand.Children) { var childNode = NodeFrom(child); //already added and expended! if (childNode != null && childNode.HasChildren) { continue; } child.Children.Each(AddNode); } }
void TreeList_BeforeExpand(object sender, BeforeExpandEventArgs e) { if (!(bool)((object[])e.Node.Tag)[1]) { DrawTree(e.Node); } }
void TreeList_BeforeExpand(object sender, BeforeExpandEventArgs e) { //if (!(bool)((object[])e.Node.Tag)[1]) DrawTree(e.Node); if (!((MyNode)e.Node.Tag).IsLoad) { DrawTree(e.Node); } }
private void treeList1_BeforeExpand(object sender, BeforeExpandEventArgs e) { if (e.Node.Tag != null) { Cursor currentCursor = Cursor.Current; Cursor.Current = Cursors.WaitCursor; InitFolders(e.Node.GetDisplayText("FullName"), e.Node); e.Node.Tag = null; Cursor.Current = currentCursor; } }
public void ObjectExplorer_OnBeforeExpand(BeforeExpandEventArgs e) { if (_refreshing) { return; } if (e.Node.Nodes.Count <= 0) { var model = GetModelForNode(e.Node); LoadDataForObjectExplorerDynamically(model); } }
private void BeforeExpand(object sender, BeforeExpandEventArgs e) { if (e.Node.Nodes.Count != 0) { return; } DataRow row = e.Node.Tag as DataRow; foreach (DataRow childRow in row.GetChildRows(row.Table.ChildRelations[0])) { TreeListNode node = MasterTreeList.AppendNode(new object[] { childRow["ID"], childRow["ParentID"], childRow["Value"] }, e.Node, childRow); node.HasChildren = childRow.Table.ChildRelations.Count != 0; } }
private void treeFile_BeforeExpand(object sender, BeforeExpandEventArgs e) { if (e.Node.GetDisplayText("Type") == "Folder" && e.Node.HasChildren && e.Node.Nodes.Count == 0) { string dirPath = e.Node.GetDisplayText("Dir"); var curNode = e.Node.ParentNode; while (curNode != null) { dirPath = curNode.GetDisplayText("Dir") + "\\" + dirPath; curNode = curNode.ParentNode; } dirPath = Path.Combine(RootFolder, dirPath); treeFile.BeginUnboundLoad(); string[] lstDir = Directory.GetDirectories(dirPath); foreach (var dir in lstDir) { string dirName = Path.GetFileName(dir); var node = treeFile.AppendNode(new object[] { "Folder", dirName }, e.Node); node.HasChildren = true; } List <string> files = new List <string>(); if (FilterString == "") { files = Directory.GetFiles(dirPath).Select(f => Path.GetFileName(f)).ToList(); } else { var lstExt = FilterString.Split(';'); foreach (var ex in lstExt) { var ff = Directory.GetFiles(dirPath, ex).Select(f => Path.GetFileName(f)).ToList(); foreach (var f in ff) { files.Add(f); } } } foreach (var file in files.OrderBy(f => f).ToList()) { var node = treeFile.AppendNode(new object[] { "File", file }, e.Node); node.HasChildren = false; } treeFile.EndUnboundLoad(); } }
private void TreeListServerFolderExplorerOnBeforeExpand(object sender, BeforeExpandEventArgs e) { if (e.Node.HasChildren && e.Node.Nodes.Count < 1) { //TODO - probably should move this to the DAL var fullPath = GetFullPathForTreeNode(e.Node, @"\"); var xpDirTreeCommand = $"exec xp_dirtree '{fullPath}', 1, 1"; DataSet dataSet = App.Connection.CurrentServer.ConnectionContext.ExecuteWithResults(xpDirTreeCommand); dataSet.Tables[0].DefaultView.Sort = "file ASC"; DataTable dataTable = dataSet.Tables[0].DefaultView.ToTable(); foreach (DataRow row in dataTable.Rows) { CreateSubDirectoryNode(e, row, fullPath); } } }
private void CreateSubDirectoryNode(BeforeExpandEventArgs e, DataRow row, string fullPath) { var subDirectory = row["subdirectory"].ToString(); var nodeIsAFile = IsThisAFile(row["file"].ToString()); if (nodeIsAFile) { if (!IsThisABackupFile(fullPath + subDirectory)) { return; } var node = e.Node.Nodes.Add(subDirectory, fullPath + subDirectory, nodeIsAFile); node.HasChildren = false; } else { var node = e.Node.Nodes.Add(subDirectory, fullPath + subDirectory, nodeIsAFile); node.HasChildren = true; } }
private void treeList_BeforeExpand(object sender, BeforeExpandEventArgs beea) { }
private void protectDoubleClickOnNode( BeforeExpandEventArgs e) { // Avoid expanding/collapsing upon double click. if (treeView.WasDoubleClick) { if (e.Node.Level > 0) { e.CanExpand = false; treeView.WasDoubleClick = false; } } }
void treeList1_BeforeExpand(object sender, BeforeExpandEventArgs e) { }
private void treeView_BeforeExpand(object sender, BeforeExpandEventArgs e) { protectDoubleClickOnNode(e); }
void tree_BeforeExpand(object sender, BeforeExpandEventArgs e) { (sender as TreeList).FocusedNode = e.Node; }
private void treeListItemCat_BeforeExpand(object sender, BeforeExpandEventArgs e) { TreeListNode focusedNode = e.Node; LoadChildNodes(focusedNode); }
void treeList1_BeforeExpand(object sender, BeforeExpandEventArgs e) { //DataRow row=treeList1.GetDataRecordByNode(e.Node) as DataRow; string id = e.Node["ID"].ToString(); if (id.Contains("_")&& e.Node.Nodes.Count==1) { e.Node.Nodes.Clear(); inittq(id.Substring(0, id.Length - 1)); } e.CanExpand = true; }
/// <summary> /// Раскрытие узла /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TreeListWrapper_BeforeExpand(object sender, BeforeExpandEventArgs e) { LoadNodes(e.Node.Tag, e.Node); }
void OnNavigationTreeNodeBeforeExpand(object sender, BeforeExpandEventArgs e) { }
void TreeList_BeforeExpand(object sender, BeforeExpandEventArgs e) { GenerateTestChildrenNodes(e.Node); }
/// <summary> /// 展开下级树 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _pwListTree_BeforeExpand(object sender, BeforeExpandEventArgs e) { _TryShowNextLevel(e.Node); return; }
private void treeList1_BeforeExpand(object sender, BeforeExpandEventArgs e) { }