Share via


FieldLabel.DisplayTemplate Property

Gets or sets the ITemplate object that is used for display mode.

Namespace:  Microsoft.SharePoint.WebControls
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
<TemplateContainerAttribute(GetType(FormComponent))> _
Public Property DisplayTemplate As ITemplate
    Get
    Set
'Usage
Dim instance As FieldLabel
Dim value As ITemplate

value = instance.DisplayTemplate

instance.DisplayTemplate = value
[TemplateContainerAttribute(typeof(FormComponent))]
public ITemplate DisplayTemplate { get; set; }

Property Value

Type: System.Web.UI.ITemplate
A ITemplate object that renders the control.

Remarks

If it is not explicitly set to something else, DisplayTemplate returns the ITemplate object named in DisplayTemplateName.

But if DisplayTemplateis set, its get accessor ignores the value of DisplayTemplateName.

It is possible for DisplayTemplate to be set to a template other than the one that is named by DisplayTemplateName. Hence, when your code sets DisplayTemplate, it should also set DisplayTemplateName to the name of the same ITemplate object. Similarly, when your code sets DisplayTemplateName, it should also set DisplayTemplate to the same ITemplate object.

If the two properties have inconsistent values, DisplayTemplate determines the template that is used for rendering the field.

See Also

Reference

FieldLabel Class

FieldLabel Members

Microsoft.SharePoint.WebControls Namespace