Rock.Web.UI.Controls.ToggleField.Initialize C# (CSharp) Method

Initialize() public method

Performs basic instance initialization for a data control field.
public Initialize ( bool sortingEnabled, Control control ) : bool
sortingEnabled bool A value that indicates whether the control supports the sorting of columns of data.
control System.Web.UI.Control The data control that owns the .
return bool
        public override bool Initialize( bool sortingEnabled, Control control )
        {
            ToggleFieldTemplate toggleFieldTemplate = new ToggleFieldTemplate();
            toggleFieldTemplate.CheckedChanged += toggleFieldTemplate_CheckedChanged;
            this.ItemTemplate = toggleFieldTemplate;
            this.ParentGrid = control as Grid;
            return base.Initialize( sortingEnabled, control );
        }