diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs index 3ea930e5..278e1e14 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs @@ -1016,7 +1016,8 @@ namespace VEPROMS if (displayHistory.MyEditItem != null && displayHistory.MyItemInfo.MyProcedure.ItemID == args.MyItemInfo.ItemID) displayHistory.MyEditItem = null; // bug fix B2016-005 - set MyCopyStep to null. This will take the paste options off of the tree node context menus. jsj 4-19-2016 - if (args.MyItemInfo.ItemID == tc.MyCopyStep.ItemID) + // B2016-105 - added null reference check -jsj + if (tc.MyCopyStep != null && args.MyItemInfo.ItemID == tc.MyCopyStep.ItemID) tc.MyCopyStep = null; bool rtval = tc.DeleteRTBItem(args.MyItemInfo); // Also disable the paste options on the ribbon if it is open. jsj 4-19-2016 diff --git a/PROMS/Volian.Controls.Library/vlnTreeView.cs b/PROMS/Volian.Controls.Library/vlnTreeView.cs index 234b6c51..de9192b1 100644 --- a/PROMS/Volian.Controls.Library/vlnTreeView.cs +++ b/PROMS/Volian.Controls.Library/vlnTreeView.cs @@ -2708,12 +2708,18 @@ namespace Volian.Controls.Library else { // The parent step was not open in the step editor, just create new step and add treenode. - using (Step step = Step.MakeStep(_LastItemInfo, _LastItemInfo.LastChild(E_FromType.Step), null, "New Step", 20002, E_FromType.Step)) + // this line (below) adds the new step to the bottom of the section, the other line (not commented) adds it to the top. Bug fix B2016-002 + //using (Step step = Step.MakeStep(_LastItemInfo, _LastItemInfo.LastChild(E_FromType.Step), null, "New Step", 20002, E_FromType.Step)) + using (Step step = Step.MakeStep(_LastItemInfo, null , null, "New Step", 20002, E_FromType.Step)) { ShowBrokenRules(step.BrokenRulesCollection); SetLastValues(StepInfo.Get(step.ItemID)); tn = new VETreeNode(_LastStepInfo); - SelectedNode.Nodes.Add(tn); // add tree node to end of list. + //SelectedNode.Nodes.Add(tn); // add tree node to end of list. + _LastStepInfo.UpdateTransitionText(); + _LastStepInfo.UpdateROText(); + TreeNode par = SelectedNode; + par.Nodes.Insert(0, tn); } }