Job Tracker Expand Tree by default

Using the Form Event Wizard add an EpiViewNotification event using the JobHead view and add to the code script
Change your code to look like this and it will expand the tree by default

// Add using
using System.Reflection;
	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();
			}
		}
	}

CodeLib_10.1.600_JobTrackerForm-AutoExpandMethodTree.xml (6.7 KB)

3 Likes