Export (0) Print
Expand All

DynamicControl.DataFormatString Property

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

Namespace:  System.Web.DynamicData
Assembly:  System.Web.DynamicData (in System.Web.DynamicData.dll)

abstract DataFormatString : string with get, set 
override DataFormatString : string with get, set
<asp:DynamicControl DataFormatString="String" />

Property Value

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

Implements

IFieldFormattingOptions.DataFormatString

Use the DataFormatString property to specify a custom display format for the values displayed in the DynamicControl control. 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 Mode property is set to ReadOnly. 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 DynamicControl control. 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.

.NET Framework

Supported in: 4.6, 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft