Rock.Web.UI.Controls.EditFieldTemplate.InstantiateIn C# (CSharp) Method

InstantiateIn() public method

When implemented by a class, defines the T:System.Web.UI.Control object that child controls and templates belong to. These child controls are in turn defined within an inline template.
public InstantiateIn ( Control container ) : void
container System.Web.UI.Control The object to contain the instances of controls from the inline template.
return void
        public void InstantiateIn( Control container )
        {
            DataControlFieldCell cell = container as DataControlFieldCell;
            if ( cell != null )
            {
                EditField editField = cell.ContainingField as EditField;
                ParentGrid = editField.ParentGrid;

                LinkButton lbEdit = new LinkButton();
                lbEdit.CausesValidation = false;
                lbEdit.CssClass = editField.ButtonCssClass;
                lbEdit.ToolTip = editField.ToolTip;

                HtmlGenericControl buttonIcon = new HtmlGenericControl( "i" );
                buttonIcon.Attributes.Add("class", editField.IconCssClass);
                lbEdit.Controls.Add( buttonIcon );

                lbEdit.Click += lbEdit_Click;
                cell.Controls.Add( lbEdit );
            }
        }