protected override void OnInit(EventArgs e) { base.OnInit(e); if (!IsDesignMode) { TemplateControl control = (TemplateControl)Page.LoadControl(_userControlPath); Controls.Add(control); _userControl = control as IDataEditControl; if (_userControl != null && DataSource != null) { IBusinessObjectDataSource dataSourceControl = DataSource; if (Property != null) { _referenceDataSource = new BusinessObjectReferenceDataSourceControl(); _referenceDataSource.DataSource = DataSource; _referenceDataSource.Property = Property; _referenceDataSource.Mode = DataSource.Mode; dataSourceControl = _referenceDataSource; Controls.Add(_referenceDataSource); } _userControl.Mode = dataSourceControl.Mode; _userControl.BusinessObject = dataSourceControl.BusinessObject; } } }
public InternalBusinessObjectReferenceDataSource(BusinessObjectReferenceDataSourceControl owner) { _owner = owner; }