diff --git a/PROMS/Volian.Controls.Library/EditItem.cs b/PROMS/Volian.Controls.Library/EditItem.cs index a5376f0d..cfdce72d 100644 --- a/PROMS/Volian.Controls.Library/EditItem.cs +++ b/PROMS/Volian.Controls.Library/EditItem.cs @@ -840,15 +840,29 @@ namespace Volian.Controls.Library } public void AddChild(E_FromType fromType, int type) { - AddChild("", fromType, type); + AddChild("", fromType, type, null); } - public void AddChild(string text, E_FromType fromType, int type) + public void AddChild(E_FromType fromType, int type, VlnFlexGrid vfGrid) + { + AddChild("", fromType, type, vfGrid); + } + public void AddChild(string text, E_FromType fromType, int type, VlnFlexGrid vfGrid) { if (_MyItemInfo.IsHigh || _MyItemInfo.IsSection) CanExpand = true; this.Expanded = true; _WatchThis = 1; ItemInfo newItemInfo = MyItemInfo.InsertChild(fromType, type, text); + if (vfGrid != null) + { + string xml = vfGrid.GetXMLData(); + using (Item itm = newItemInfo.Get()) + { + itm.MyContent.MyGrid.Data = xml; + itm.Save(); + // newItemInfo.MyContent.MyGrid.ResetContent(itm.MyContent.MyGrid); // Do I need this? + } + } // TODO: We need to determine where this will go in the stack of children EditItem nextItem = null; if (newItemInfo.NextItem != null)