DisplayFormatAttribute.ApplyFormatInEditMode 속성

정의

데이터 필드가 편집 모드에 있는 경우 DataFormatString 속성에서 지정하는 서식 문자열이 필드 값에 적용되는지 여부를 나타내는 값을 가져오거나 설정합니다.

public:
 property bool ApplyFormatInEditMode { bool get(); void set(bool value); };
public bool ApplyFormatInEditMode { get; set; }
member this.ApplyFormatInEditMode : bool with get, set
Public Property ApplyFormatInEditMode As Boolean

속성 값

편집 모드에서 필드 값에 서식 문자열이 적용되면 true이고, 그렇지 않으면 false입니다. 기본값은 false입니다.

예제

다음 예제에서는 사용 ApplyFormatInEditMode 하는 방법에 설명 합니다 데이터 필드 편집 모드에서 날짜 정보에 대 한 표시 형식을 설정 하는 속성입니다. 데이터 필드에 사용할 데이터 필드 형식은 속성을 설정 DataFormatString 하여 지정됩니다.

// Display date data field in the short format 11/12/08.
// Also, apply format in edit mode.
[DisplayFormat(ApplyFormatInEditMode=true, DataFormatString = "{0:d}")]
public object SellStartDate;
' Display date data field in the short format such as 11/12/08.
' Also, apply format in edit mode.
<DisplayFormat(ApplyFormatInEditMode:=True, DataFormatString:="{0:d}")> _
Public SellStartDate As Object

설명

기본적으로 속성에 지정된 서식 문자열은 데이터 바인딩된 DataFormatString 컨트롤이 읽기 전용 모드인 경우에만 필드 값에 적용됩니다.

적용 대상