MGoed
(Mike)
May 21, 2025, 1:22pm
1
Upon opening a project in project entry the tree with phases, milestones etc. is expanded. This is making it way too cluttered so we always collapse everything before working on the project. Is there a way to have it collapsed upon opening the project by default (preferably via standard settings)?
The way it opens (as you can see, we use a classic form for project entry still):
Randy
(Randy Stulce)
May 21, 2025, 2:19pm
2
You’d have to make a customization and I’m not sure it’s worth it with Classic sunset a year away.
1 Like
Below is code used to expand the job tree, I’m guessing you could use something very similar but do CollapseAll vs ExpandAll
// Add using
using System.Reflection;
using Infragistics.Win.UltraWinTree;
private void edvJobHead_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
{
// ** Argument Properties and Uses **
// view.dataView[args.Row]["FieldName"]
// args.Row, args.Column, args.Sender, args.NotifyType
// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
if ((args.NotifyType == EpiTransaction.NotifyType.Initialize))
{
if ((args.Row > -1))
{
Ice.Lib.Framework.JobLib.MethodTree methodTree = default(Ice.Lib.Framework.JobLib.MethodTree);
FieldInfo fieldInfo = default(FieldInfo);
Ice.Lib.Framework.JobLib.MethodTreePanel treeviewPanel = default(Ice.Lib.Framework.JobLib.MethodTreePanel);
fieldInfo = typeof(Erp.UI.App.JobTracker.JobTrackerForm).GetField("jobTreeViewPanel", BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Instance);
treeviewPanel = (Ice.Lib.Framework.JobLib.MethodTreePanel) fieldInfo.GetValue(JobTrackerForm);
methodTree = treeviewPanel.MethodTree;
methodTree.ExpandAll();
}
}
}
// or Expand FIRST Level nodes only
private void edvJobHead_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
{
// ** Argument Properties and Uses **
// view.dataView[args.Row]["FieldName"]
// args.Row, args.Column, args.Sender, args.NotifyType
// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
if ((args.NotifyType == EpiTransaction.NotifyType.Initialize))
{
if ((args.Row > -1))
{
Ice.Lib.Framework.JobLib.MethodTree methodTree = default(Ice.Lib.Framework.JobLib.MethodTree);
FieldInfo fieldInfo = default(FieldInfo);
Ice.Lib.Framework.JobLib.MethodTreePanel treeviewPanel = default(Ice.Lib.Framework.JobLib.MethodTreePanel);
fieldInfo = typeof(Erp.UI.App.JobTracker.JobTrackerForm).GetField("jobTreeViewPanel", BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Instance);
treeviewPanel = (Ice.Lib.Framework.JobLib.MethodTreePanel) fieldInfo.GetValue(JobTrackerForm);
methodTree = treeviewPanel.MethodTree;
foreach ( UltraTreeNode rootNode in methodTree.Nodes )
IterateNodes( rootNode );
}
}
}
private void IterateNodes ( UltraTreeNode node )
{
foreach ( UltraTreeNode childNode in node.Nodes )
{
if (childNode.ToString() == "Operations")
{
childNode.ExpandAll();
}
IterateNodes ( childNode );
}
}
2 Likes
Randy
(Randy Stulce)
May 21, 2025, 2:55pm
4
I was searching the files for the code to do that. Beat me too it but glad you posted it.
MGoed
(Mike)
May 22, 2025, 5:02am
5
Aah, that’s what I feared. Thanks for the quick reply guys!