DataGridView.NotifyCurrentCellDirty(Boolean) Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Notifica que DataGridView a célula atual tem alterações não comprometidas.
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)
Parâmetros
- dirty
- Boolean
true para indicar que a célula tem alterações não comprometidas; caso contrário, false.
Exemplos
O exemplo de código seguinte ilustra a utilização deste método num cenário de célula personalizada. No exemplo, uma IDataGridViewEditingControl implementação derivada da DateTimePicker classe sobrepõe o OnValueChanged método e usa o NotifyCurrentCellDirty método para indicar uma alteração ao DataGridView controlo.
Este exemplo faz parte de um exemplo mais amplo mostrado em How to: Host Controls in Windows Forms DataGridView Cells.
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
Observações
Este método pode ser usado para permitir que tipos de células personalizados notifiquem quando DataGridView têm alterações não comprometidas.