/// <summary> /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create /// any child controls they contain in preparation for posting back or rendering. /// </summary> protected override void CreateChildControls() { if (this.InnerProperty == null || this.Page == null) { return; } RenderType currentRenderType = this.GetCurrentRenderType(); if (this.Page.IsPostBack && this.LastRenderType != currentRenderType) { this.ClearChildViewState(); } IPropertyControl propertyControl1 = PropertyControlClassFactory.Instance.CreatePropertyControl( this.InnerProperty, new HttpContextWrapper(HttpContext.Current), this.Page, this.RenderSettings.Tag); if (propertyControl1 != null) { this.Controls.Add((Control)propertyControl1); propertyControl1.PropertyData = this.InnerProperty; propertyControl1.RenderType = currentRenderType; propertyControl1.ValidationGroup = this.ValidationGroup; propertyControl1.Enabled = this.Enabled; PropertyDataControl propertyControl2 = propertyControl1 as PropertyDataControl; if (propertyControl2 != null) { propertyControl2.AttributeSourceControl = this; propertyControl2.CustomTagName = this.CustomTagName; propertyControl2.CssClass = this.CssClass; this.AssignCustomSettings(propertyControl2); } propertyControl1.SetupControl(); } this.LastRenderType = currentRenderType; this._isDirty = false; }
/// <summary> /// Assigns the custom settings. /// </summary> /// <param name="propertyControl">The property control.</param> private void AssignCustomSettings(PropertyDataControl propertyControl) { propertyControl.EditorSettings = this.EditorSettings.Settings; propertyControl.RenderSettings = this.RenderSettings.Settings; propertyControl.OverlaySettings = this.OverlaySettings.Settings; }