DataControlField.OnFieldChanged Método
Definição
Aciona o evento FieldChanged.Raises the FieldChanged event.
protected:
virtual void OnFieldChanged();
protected virtual void OnFieldChanged ();
abstract member OnFieldChanged : unit -> unit
override this.OnFieldChanged : unit -> unit
Protected Overridable Sub OnFieldChanged ()
Comentários
O OnFieldChanged método gera um evento sinalizando que o DataControlField estado do objeto foi alterado.The OnFieldChanged method raises an event signaling that the DataControlField object's state has changed. As alterações nas seguintes propriedades fazem com que esse evento seja gerado: FooterText ,, HeaderImageUrl ,, HeaderText ShowHeader SortExpression e Visible .Changes to the following properties cause this event to be raised: FooterText, HeaderImageUrl, HeaderText, ShowHeader, SortExpression, and Visible. As propriedades de tipo derivado também geram esse evento quando ocorrem alterações de estado.Derived type properties also raise this event when state changes occur. Controles de servidor Web, como DetailsView e GridView normalmente chamam o DataBind método em resposta a um evento de alteração de campo.Web server controls such as DetailsView and GridView typically call the DataBind method in response to a field change event.
A geração de um evento invoca o manipulador de eventos por meio de um delegado.Raising an event invokes the event handler through a delegate. Para obter mais informações, consulte manipulando e gerando eventos.For more information, see Handling and Raising Events.
O OnFieldChanged método também permite que classes derivadas manipulem o evento sem anexar um delegado.The OnFieldChanged method also allows derived classes to handle the event without attaching a delegate. Essa é a técnica preferida para manipular o evento em uma classe derivada.This is the preferred technique for handling the event in a derived class.
Notas aos Herdeiros
Ao substituir OnFieldChanged() em uma classe derivada, certifique-se de chamar o método da classe base OnFieldChanged() para que os delegados registrados recebam o evento.When overriding OnFieldChanged() in a derived class, be sure to call the base class's OnFieldChanged() method so that registered delegates receive the event.