<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0-rc.2.20475.5" />

System.ComponentModel.DataAnnotations.DisplayFormatAttribute

Specifies how data fields are displayed and formatted by ASP.NET Dynamic Data.
public bool ApplyFormatInEditMode { get; set; }

Gets or sets a value that indicates whether the formatting string that is specified by the DataFormatString property is applied to the field value when the data field is in edit mode.

public bool ConvertEmptyStringToNull { get; set; }

Gets or sets a value that indicates whether empty string values ("") are automatically converted to null when the data field is updated in the data source.

public string DataFormatString { get; set; }

Gets or sets the display format for the field value.

public bool HtmlEncode { get; set; }

Gets or sets a value that indicates whether the field should be HTML-encoded.

public string NullDisplayText { get; set; }

Gets or sets the text that is displayed for a field when the field's value is null.

public Type NullDisplayTextResourceType { get; set; }

Gets or sets the Type that contains the resources for NullDisplayText. Using NullDisplayTextResourceType along with NullDisplayText, allows the GetNullDisplayText method to return localized values.

Initializes a new instance of the DisplayFormatAttribute class.

public string GetNullDisplayText()

Returns the UI display string for NullDisplayText.