DetailsViewDesigner Class
Assembly: System.Design (in system.design.dll)
In a visual designer, when you switch from Source to Design view, the markup source code that describes the DetailsView control is parsed and a design-time version of the control is created on the design surface. When you switch back to Source view, the design-time control is persisted to markup source code and edited into the markup for the Web page.
The properties of the DetailsViewDesigner class 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 AutoFormats property returns a collection of formatting schemes for display in the Auto Format dialog box.
-
The TemplateGroups property returns a collection of template groups for the fields of the associated DetailsView control and the top level DetailsView templates.
-
The UsePreviewControl property always returns true, indicating that the designer creates a temporary copy of the associated DetailsView control to generate the design-time markup.
The DetailsViewDesigner class methods provide the following functionality:
-
The DataBind method binds the associated DetailsView control to a design-time data source.
-
The GetDesignTimeHtml method returns the markup that is used to render the associated DetailsView at design time.
-
The Initialize method prepares the designer to view, edit, and design the associated DetailsView.
-
The OnClick method is called when a region of the design-time view of the associated DetailsView is clicked.
-
The OnSchemaRefreshed method is called when the schema of the data source of the associated DetailsView changes.
-
The PreFilterProperties method is used to remove or add additional properties or to shadow properties of the associated DetailsView.
Design-time editable regions are not supported in the DetailsView control, so the GetEditableDesignerRegionContent and SetEditableDesignerRegionContent methods have no functionality.
The following code example shows how to extend the DetailsViewDesigner class to change the appearance of controls that are derived from the DetailsView control at design time.
The example derives the MyDetailsView control from the DetailsView. The MyDetailsView is simply a copy of the DetailsView control. The example also derives the MyDetailsViewDesigner class from DetailsViewDesigner and places a DesignerAttribute object for MyDetailsViewDesigner on the MyDetailsView control.
The MyDetailsViewDesigner overrides the SampleRowCount property to specify that the pager row of the design-time view of the MyDetailsView contain five page links. It overrides the PreFilterProperties method to make the NamingContainer property visible in the Property grid at design time. It overrides the GetDesignTimeHtml method to include the Caption property, if it is specified, as a new first row in the MyDetailsView grid at design time. If the BorderStyle property of the MyDetailsView is the NotSet or None value, the GetDesignTimeHtml draws a blue dashed border around the control to make its extent more visible.
System.ComponentModel.Design.ComponentDesigner
System.Web.UI.Design.HtmlControlDesigner
System.Web.UI.Design.ControlDesigner
System.Web.UI.Design.WebControls.BaseDataBoundControlDesigner
System.Web.UI.Design.WebControls.DataBoundControlDesigner
System.Web.UI.Design.WebControls.DetailsViewDesigner