DataGridView.NotifyCurrentCellDirty(Boolean) 메서드

정의

현재 셀에 커밋되지 않은 변경 내용이 있음을 DataGridView에 알립니다.

public:
 virtual void NotifyCurrentCellDirty(bool dirty);
public virtual void NotifyCurrentCellDirty (bool dirty);
abstract member NotifyCurrentCellDirty : bool -> unit
override this.NotifyCurrentCellDirty : bool -> unit
Public Overridable Sub NotifyCurrentCellDirty (dirty As Boolean)

매개 변수

dirty
Boolean

셀에 커밋되지 않은 변경 내용이 있음을 나타내려면true 이고, 그렇지 않으면 false입니다.

예제

다음 코드 예제에서는 사용자 지정 셀 시나리오에서 이 메서드를 사용하는 방법을 보여 줍니다. 이 예제 IDataGridViewEditingControl 에서 클래스에서 DateTimePicker 파생된 구현은 메서드를 재정의 OnValueChanged 하고 메서드를 NotifyCurrentCellDirty 사용하여 컨트롤의 변경 사항을 DataGridView 나타냅니다.

이 예제는 방법: Windows Forms DataGridView 셀의 호스트 컨트롤에 표시된 더 큰 예제의 일부입니다.

protected override void OnValueChanged(EventArgs eventargs)
{
    // Notify the DataGridView that the contents of the cell
    // have changed.
    valueChanged = true;
    this.EditingControlDataGridView.NotifyCurrentCellDirty(true);
    base.OnValueChanged(eventargs);
}
Protected Overrides Sub OnValueChanged(ByVal eventargs As EventArgs)

    ' Notify the DataGridView that the contents of the cell have changed.
    valueIsChanged = True
    Me.EditingControlDataGridView.NotifyCurrentCellDirty(True)
    MyBase.OnValueChanged(eventargs)

End Sub

설명

이 메서드를 사용하여 커밋되지 않은 변경 내용이 있는 경우 사용자 지정 셀 형식에 DataGridView 알릴 수 있습니다.

적용 대상

추가 정보