Editar

Partilhar via


DynamicField.DataFormatString Property

Definition

Gets or sets the string that specifies the display format for the value of the data field.

public:
 property System::String ^ DataFormatString { System::String ^ get(); void set(System::String ^ value); };
public string DataFormatString { get; set; }
member this.DataFormatString : string with get, set
Public Property DataFormatString As String

Property Value

A formatting string that specifies the display format for the value of the data field. The default is an empty string (""), which indicates that no special formatting is applied to the value.

Remarks

Use the DataFormatString property to specify a custom display format for the values displayed in the DynamicField object. If the DataFormatString property is not set, the field value is displayed without any special formatting.

By default, the formatting string is applied to the field value only when the data-bound control that contains the DynamicField object is in read-only mode. To apply the formatting string to the field value while in edit mode, set the ApplyFormatInEditMode property to true.

The display format that you specify using the DataFormatString property is specific to this instance of the DynamicField class. You can also change the display format for a data field across the entire application by applying the DisplayFormatAttribute to your data model and setting the DisplayFormatAttribute.DataFormatString named parameter in the constructor. For more information, see ASP.NET Dynamic Data.

Applies to

See also