Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​ComponentModel.​DataAnnotations.​DisplayFormatAttribute
Assembly: System.ComponentModel.Annotations
Inheritance: object → Attribute → DisplayFormatAttribute
Specifies how data fields are displayed and formatted by ASP.NET Dynamic Data.
Properties
public
bool
ApplyFormatInEditMode
Gets or sets a value that indicates whether the formatting string that is specified by the <see cref="P:System.ComponentModel.DataAnnotations.DisplayFormatAttribute.DataFormatString" /> property is applied to the field value when the data field is in edit mode.
public
bool
ConvertEmptyStringToNull
Gets or sets a value that indicates whether empty string values ("") are automatically converted to <see langword="null" /> when the data field is updated in the data source.
public
string
DataFormatString
Gets or sets the display format for the field value.
public
bool
HtmlEncode
Gets or sets a value that indicates whether the field should be HTML-encoded.
public
string
NullDisplayText
Gets or sets the text that is displayed for a field when the field's value is <see langword="null" /> .
public
Type
NullDisplayTextResourceType
Gets or sets the <see cref="T:System.Type" /> that contains the resources for <see cref="P:System.ComponentModel.DataAnnotations.DisplayFormatAttribute.NullDisplayText" /> .
Using <see cref="P:System.ComponentModel.DataAnnotations.DisplayFormatAttribute.NullDisplayTextResourceType" /> along with <see cref="P:System.ComponentModel.DataAnnotations.DisplayFormatAttribute.NullDisplayText" /> , allows the <see cref="M:System.ComponentModel.DataAnnotations.DisplayFormatAttribute.GetNullDisplayText" /> method to return localized values.
public
object
TypeId
Methods
public
string
GetNullDisplayText​()
Returns the UI display string for <see cref="P:System.ComponentModel.DataAnnotations.DisplayFormatAttribute.NullDisplayText" /> .
Returns <para>The UI display string.</para> <para>If <see cref="P:System.ComponentModel.DataAnnotations.DisplayFormatAttribute.NullDisplayTextResourceType" /> has not been specified, the value of <see cref="P:System.ComponentModel.DataAnnotations.DisplayFormatAttribute.NullDisplayText" /> is returned.</para> <para>If <see cref="P:System.ComponentModel.DataAnnotations.DisplayFormatAttribute.NullDisplayTextResourceType" /> has been specified and <see cref="P:System.ComponentModel.DataAnnotations.DisplayFormatAttribute.NullDisplayText" /> represents a resource key within that resource type, the localized value is returned.</para> <para>If <see cref="P:System.ComponentModel.DataAnnotations.DisplayFormatAttribute.NullDisplayText" /> and <see cref="P:System.ComponentModel.DataAnnotations.DisplayFormatAttribute.NullDisplayTextResourceType" /> have not been set, returns <see langword="null" />.</para>
protected
void
Finalize​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object