다음을 통해 공유


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 서식 문자열은 데이터 바인딩된 컨트롤이 읽기 전용 모드인 경우에만 필드 값에 적용됩니다.

적용 대상