DataGridViewRowErrorTextNeededEventArgs 클래스

정의

RowErrorTextNeeded 컨트롤의 DataGridView 이벤트에 대한 데이터를 제공합니다.

public ref class DataGridViewRowErrorTextNeededEventArgs : EventArgs
public class DataGridViewRowErrorTextNeededEventArgs : EventArgs
type DataGridViewRowErrorTextNeededEventArgs = class
    inherit EventArgs
Public Class DataGridViewRowErrorTextNeededEventArgs
Inherits EventArgs
상속
DataGridViewRowErrorTextNeededEventArgs

예제

다음 코드 예제에서는이 형식 사용 하는 방법을 보여 줍니다. 예제에서는 이벤트 처리기에서 보고서를 RowErrorTextNeeded 이벤트입니다. 이 보고서를 통해 이벤트 발생 하 고 도움이 될 수 있습니다 디버깅 하는 경우를 학습할 수 있습니다. 자주 발생 하는 이벤트 또는 여러 이벤트를 보고 하려면 바꾸는 것이 좋습니다 Show 사용 하 여 Console.WriteLine 줄에 메시지를 추가 또는 TextBox합니다.

예제 코드를 실행 하려면 형식의 인스턴스를 포함 하는 프로젝트에 붙여넣습니다 DataGridView 라는 DataGridView1합니다. 연결 된 이벤트 처리기는 확인 된 RowErrorTextNeeded 이벤트입니다.

private void DataGridView1_RowErrorTextNeeded(Object sender, DataGridViewRowErrorTextNeededEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "ErrorText", e.ErrorText );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "RowIndex", e.RowIndex );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "RowErrorTextNeeded Event" );
}
Private Sub DataGridView1_RowErrorTextNeeded(sender as Object, e as DataGridViewRowErrorTextNeededEventArgs) _ 
     Handles DataGridView1.RowErrorTextNeeded

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "ErrorText", e.ErrorText)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "RowIndex", e.RowIndex)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"RowErrorTextNeeded Event")

End Sub

설명

RowErrorTextNeeded 이벤트에만 발생 경우를 DataGridView 컨트롤 DataSource 속성을 설정 또는 해당 VirtualMode 속성은 true합니다. RowErrorTextNeeded 이벤트 처리는 해당 상태 및 포함된 값에 따라 행에 대한 오류를 확인하려는 경우에 유용합니다.

이벤트를 처리 RowErrorTextNeeded 하고 처리기에서 오류 텍스트를 지정하면 속성이 로 설정false되지 않는 한 행 머리글에 DataGridView.ShowRowErrors 오류 문자 모양이 나타납니다. 사용자가 오류 문자 모양 위로 마우스 포인터를 이동하면 도구 설명에 오류 텍스트가 나타납니다.

RowErrorTextNeeded 이벤트는 속성의 값을 검색할 DataGridViewRow.ErrorText 때마다 발생합니다.

사용할 수 있습니다는 RowIndex 속성을 행의 상태 또는 값을 확인 하 고이 정보를 변경 하거나 수정 하는 ErrorText 속성입니다. 이 속성은 행의 값을 사용 하 여 초기화 ErrorText 이벤트 값을 재정의 하는 속성입니다.

처리를 RowErrorTextNeeded 대량의 행을 설정 하는 성능 저하를 방지 하려면 데이터를 작업할 때 이벤트 ErrorText 여러 행에 대 한 값입니다. 자세한 내용은 Windows Forms DataGridView 컨트롤의 크기를 조정하는 최선의 방법을 참조하세요.

이벤트를 처리 하는 방법에 대 한 자세한 내용은 참조 하세요. 이벤트 처리 및 발생합니다.

속성

ErrorText

행의 오류 텍스트를 가져오거나 설정합니다.

RowIndex

RowErrorTextNeeded 이벤트를 발생시킨 행을 가져옵니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상

추가 정보