TemplateField.FooterTemplate Property
Assembly: System.Web (in system.web.dll)
[TemplateContainerAttribute(typeof(IDataItemContainer))] public: virtual property ITemplate^ FooterTemplate { ITemplate^ get (); void set (ITemplate^ value); }
/** @property */ public ITemplate get_FooterTemplate () /** @property */ public void set_FooterTemplate (ITemplate value)
public function get FooterTemplate () : ITemplate public function set FooterTemplate (value : ITemplate)
Property Value
A System.Web.UI.ITemplate-implemented object that contains the template for displaying the footer section of a TemplateField. The default is a null reference (Nothing in Visual Basic), which indicates that this property is not set.Use the FooterTemplate property to specify the custom content displayed in the footer section of a TemplateField object. Define the content by creating a template that specifies how the footer section is rendered.
To specify a template, first place opening and closing <FooterTemplate> tags between the opening and closing tags of the <TemplateField> element. Next, add the custom content between the opening and closing <FooterTemplate> tags. The content can be as simple as plain text or more complex (embedding other controls in the template, for example).
To programmatically access a control defined in a template, first determine which TableCell object in the data-bound control contains the control. Next, use the Controls collection of the TableCell object to access the control. You can also use the FindControl method of the TableCell object to find the control, if the control has an ID property specified.
The following code example demonstrates how to use the FooterTemplate property to create a custom template for the footer section of a TemplateField field column in a GridView control. The template displays the sum of the values in the TemplateField field column.
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.