BoundField::ApplyFormatInEditMode Property
Gets or sets a value indicating whether the formatting string specified by the DataFormatString property is applied to field values when the data-bound control that contains the BoundField object is in edit mode.
Assembly: System.Web (in System.Web.dll)
public: virtual property bool ApplyFormatInEditMode { bool get (); void set (bool value); }
Property Value
Type: System::Booleantrue to apply the formatting string to field values in edit mode; otherwise, false. The default is false.
Data-bound controls (such as DetailsView, FormView, and GridView) have different display modes that allow the user to read, edit, or insert records. By default, the formatting string specified by the DataFormatString property is applied to field values only when the data-bound control is in read-only mode. To apply the formatting string to values displayed while the data-bound control is in edit mode, set the ApplyFormatInEditMode property to true.
Note: |
|---|
A BoundField object does not automatically remove the formatting when the field is updated in the data source. If you do not want the formatting as part of the value stored, you will need to remove the formatting programmatically. |
The following code example demonstrates how to use the ApplyFormatInEditMode property to apply the formatting string to field values while a GridView control is in edit mode. The formatting is then programmatically removed before the value is updated in the data source.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note: