DataGridViewCell.GetEditedFormattedValue 메서드

정의

셀이 편집 모드에 있고 값이 커밋되지 않았는지 여부와 관계없이 셀의 형식이 지정된 현재 값을 반환합니다.

public:
 System::Object ^ GetEditedFormattedValue(int rowIndex, System::Windows::Forms::DataGridViewDataErrorContexts context);
public object GetEditedFormattedValue (int rowIndex, System.Windows.Forms.DataGridViewDataErrorContexts context);
public object? GetEditedFormattedValue (int rowIndex, System.Windows.Forms.DataGridViewDataErrorContexts context);
member this.GetEditedFormattedValue : int * System.Windows.Forms.DataGridViewDataErrorContexts -> obj
Public Function GetEditedFormattedValue (rowIndex As Integer, context As DataGridViewDataErrorContexts) As Object

매개 변수

rowIndex
Int32

셀의 행 인덱스입니다.

context
DataGridViewDataErrorContexts

데이터 오류 컨텍스트를 지정하는 DataGridViewDataErrorContexts 값의 비트 조합입니다.

반환

DataGridViewCell의 형식이 지정된 현재 값입니다.

예외

지정된 rowIndex가 0보다 작거나 컨트롤의 행 수에서 1을 뺀 값보다 큰 경우

ColumnIndex가 0보다 작아 셀이 행 머리글 셀임을 나타내는 경우

형식 지정이 실패하고 DataError 컨트롤의 DataGridView 이벤트에 대한 처리기가 없거나 처리기에서 ThrowException 속성을 true로 설정한 경우. 예외 개체는 일반적으로 FormatException 형식으로 캐스팅할 수 있습니다.

설명

이 메서드는 셀이 편집 모드인 경우 편집 셀 또는 편집 컨트롤의 현재 값을 반환합니다. 그렇지 않으면 이 메서드는 셀 값을 속성으로 표시된 형식의 동일한 표시 값으로 FormattedValueType 변환합니다. 이렇게 하면 값 변환을 DataGridView.CellFormatting 사용자 지정하기 위해 처리할 수 있는 이벤트가 발생합니다.

정상적이 지 않습니다 서식 지정 하는 경우는 DataGridView.DataError 이벤트가 발생 합니다. 이 이벤트 또는 처리기 집합에 대 한 처리기가 하는 경우는 DataGridViewDataErrorEventArgs.ThrowException 속성을 true, 예외가 throw 됩니다.

이 메서드를 재정의하는 파생 클래스는 일반적으로 인수에 값이 포함된 경우 셀 값의 문자열 표현을 contextClipboardContent 반환합니다.

적용 대상

추가 정보