diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs index 1c32426a..2ce97b3d 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs @@ -284,7 +284,7 @@ namespace VEPROMS.CSLA.Library public ItemInfo InsertSiblingBefore(string text, string number) { ItemInfo tmp = null; - if (FormatStepData.UseSmartTemplate || MyHLS.FormatStepData.UseSmartTemplate) + if (!IsSection && (FormatStepData.UseSmartTemplate || MyHLS.FormatStepData.UseSmartTemplate)) tmp = InsertSmartTemplateSteps(text, number, tmp, EAddpingPart.Before, (int)MyContent.Type); else tmp = NewItemInfoFetch(ItemID, EAddpingPart.Before, number, text, null, null, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID); @@ -410,7 +410,7 @@ namespace VEPROMS.CSLA.Library public ItemInfo InsertSiblingAfter(string text, string number, int? type) { ItemInfo tmp = null; - if (FormatStepData.UseSmartTemplate || MyHLS.FormatStepData.UseSmartTemplate) + if (!IsSection &&(FormatStepData.UseSmartTemplate || MyHLS.FormatStepData.UseSmartTemplate)) tmp = InsertSmartTemplateSteps(text, number, tmp, EAddpingPart.After, (int)MyContent.Type); else tmp = NewItemInfoFetch(ItemID, EAddpingPart.After, number, text, type, null, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID); diff --git a/PROMS/Volian.Controls.Library/StepTabPanel.cs b/PROMS/Volian.Controls.Library/StepTabPanel.cs index eae6057e..7962169e 100644 --- a/PROMS/Volian.Controls.Library/StepTabPanel.cs +++ b/PROMS/Volian.Controls.Library/StepTabPanel.cs @@ -57,7 +57,8 @@ namespace Volian.Controls.Library set { _MyStepPanel.SelectedEditItem = _MyStepPanel.GetEditItem(value); - _MyStepPanel.SelectedEditItem.ItemSelect(); + if (_MyStepPanel.SelectedEditItem != null) + _MyStepPanel.SelectedEditItem.ItemSelect(); if (!_MyStepPanel.ItemSelectionChangeShown) _MyStepPanel.OnItemSelectedChanged(this, new ItemSelectedChangedEventArgs(_MyStepPanel.SelectedEditItem)); } }