Assembly: System.Design (in system.design.dll)
public ref class HierarchicalDataBoundControlDesigner : public BaseDataBoundControlDesigner
In a designer host, when the user switches from Source to Design view, the markup source code that describes a control that is derived from the HierarchicalDataBoundControl abstract class is parsed and a design-time version of the control is created on the design surface. When the user switches back to Source view, the design-time control is persisted to markup source code and edited into the markup for the Web page. The HierarchicalDataBoundControlDesigner class provides design-time support for controls that are derived from the HierarchicalDataBoundControl in a designer host.
The HierarchicalDataBoundControlDesigner class properties provide the following functionality:
The ActionLists property returns a DesignerActionListCollection object, which typically contains an object that is derived from the DesignerActionList class for each level in the inheritance tree of the designer.
The DataSourceDesigner property provides access to the designer of the data source, if one is defined.
The DesignerView property gets the default view of the data source that is bound to the associated control.
The UseDataSourcePickerActionList property determines whether the control should render its default action lists for choosing and creating data sources.
The HierarchicalDataBoundControlDesigner class methods provide the following functionality:
The ConnectToDataSource method performs the actions that are necessary to connect to the current data source.
The CreateDataSource method creates a new data source for the associated control.
The DataBind method binds the associated control that is derived from the HierarchicalDataBoundControl class to a design-time data source.
The DisconnectFromDataSource method performs the actions that are necessary to disconnect from the current data source.
The GetDesignTimeDataSource method gets a data source that can be used at design time for the associated control.
The GetSampleDataSource method constructs a sample data source that can be used at design time for the associated control.
The PreFilterProperties method is used to remove properties from or add additional properties to or to shadow properties of the associated control that is derived from the HierarchicalDataBoundControl class.
The following code example shows how to extend the HierarchicalDataBoundControlDesigner class to change the appearance of controls that are derived from the HierarchicalDataBoundControl control at design time.
The example derives the MyHierarchicalDataBoundControl class from the HierarchicalDataBoundControl. The MyHierarchicalDataBoundControl class is simply a copy of the HierarchicalDataBoundControl. The example also derives the MyHierarchicalDataBoundControlDesigner class from the HierarchicalDataBoundControlDesigner class and places a DesignerAttribute object for the MyHierarchicalDataBoundControlDesigner on the MyHierarchicalDataBoundControl class.
The MyHierarchicalDataBoundControlDesigner overrides the PreFilterProperties method to make the NamingContainer property visible in the Properties grid at design time. It overrides the GetDesignTimeHtml method to generate the markup for a placeholder if the design time markup is a null reference (Nothing in Visual Basic) or Empty, or if the design-time markup is an empty <span> block (that is, if there is no inner markup between the <span …> and </span> tags).