public DesignSurfaceExt2 AddReportSectionDesignSurface(Control parent, ReportDesignerUserControl rduc) { this.ReportDesignerUserControl = rduc; DesignSurfaceExt2 surface = DesignSurfaceManager.CreateDesignSurfaceExt2(); this.DesignSurfaceManager.ActiveDesignSurface = surface; surface.UseSnapLines(); surface.GetUndoEngineExt().Enabled = true; surface.GetIToolboxService().Toolbox = this.Toolbox; Control rootComponent = surface.CreateRootComponent(typeof(EbReportPanel), new Size(1, 1)) as Control; rootComponent.Site.Name = this.DesignSurfaceManager.GetValidFormName(); (rootComponent as EbReportPanel).ReportDesignerUserControl = this.ReportDesignerUserControl; surface.EnableDragandDrop(); // DO THIS AFTER CREATING rootComponent IComponentChangeService componentChangeService = (IComponentChangeService)(surface.GetService(typeof(IComponentChangeService))); if (null != componentChangeService) { componentChangeService.ComponentChanged += (Object sender, ComponentChangedEventArgs e) => { if (e.Component is IEbControl) { (e.Component as IEbControl).DoDesignerRefresh(); } }; componentChangeService.ComponentAdding += (Object sender, ComponentEventArgs e) => { if (surface.GetIToolboxService().Toolbox.SelectedItem != null) { var fieldname = (surface.GetIToolboxService().Toolbox.SelectedItem as ToolboxItem).DisplayName; if (e.Component is EbReportFieldTextControl) { (e.Component as EbReportFieldTextControl).EbControl.Name = fieldname; (e.Component as EbReportFieldTextControl).EbControl.Label = fieldname; } else if (e.Component is EbReportFieldNumericControl) { (e.Component as EbReportFieldNumericControl).EbControl.Name = fieldname; (e.Component as EbReportFieldNumericControl).EbControl.Label = fieldname; } } }; componentChangeService.ComponentAdded += (Object sender, ComponentEventArgs e) => { DesignSurfaceManager.UpdatePropertyGridHost(surface); }; componentChangeService.ComponentRemoved += (Object sender, ComponentEventArgs e) => { DesignSurfaceManager.UpdatePropertyGridHost(surface); }; } Control view = surface.GetView(); if (null == view) { return(null); } view.Dock = DockStyle.Fill; view.Parent = parent; return(surface); }