ControlDesigner::TemplateGroups Property
Gets a collection of template groups, each containing one or more template definitions.
Assembly: System.Design (in System.Design.dll)
public: property TemplateGroupCollection^ TemplateGroups { virtual TemplateGroupCollection^ get(); }
Property Value
Type: System.Web.UI.Design::TemplateGroupCollection^A collection of TemplateGroup objects. The default is an empty TemplateGroupCollection.
Notes to Inheritors:
You can modify the TemplateGroups collection directly, or you can leave it unchanged. If you are overriding the TemplateGroups property, call the base implementation before you add template groups to the collection.
The following code example demonstrates how to create a control designer class that derives from the ControlDesigner class. This control designer supports a control with four possible templates.
To try it, compile the code, and then, in a design host such as Visual Studio 2005, view the page in Design view. Select the control, click the action list to select a template to modify, and then use the drag-and-drop feature to move controls into the template.
<%@ Page Language="VB" %> <%@ Register TagPrefix="aspSample" Namespace="ASPNet.Design.Samples" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <aspSample:TemplateGroupsSample runat="server" ID="TGSample1"> </aspSample:TemplateGroupsSample> </div> </form> </body> </html>
Available since 2.0