DataGridView.OnNewRowNeeded(DataGridViewRowEventArgs) Método

Definición

Genera el evento NewRowNeeded.Raises the NewRowNeeded event.

protected:
 virtual void OnNewRowNeeded(System::Windows::Forms::DataGridViewRowEventArgs ^ e);
protected virtual void OnNewRowNeeded (System.Windows.Forms.DataGridViewRowEventArgs e);
abstract member OnNewRowNeeded : System.Windows.Forms.DataGridViewRowEventArgs -> unit
override this.OnNewRowNeeded : System.Windows.Forms.DataGridViewRowEventArgs -> unit
Protected Overridable Sub OnNewRowNeeded (e As DataGridViewRowEventArgs)

Parámetros

e
DataGridViewRowEventArgs

Objeto DataGridViewRowEventArgs que contiene los datos del evento.A DataGridViewRowEventArgs that contains the event data.

Excepciones

La fila indicada por la propiedad Row de e no pertenece a este control de DataGridView.The row indicated by the Row property of e does not belong to this DataGridView control.

Comentarios

Cuando se genera un evento, se invoca el controlador de eventos a través de un delegado.Raising an event invokes the event handler through a delegate. Para obtener más información, consulte controlar y provocar eventos.For more information, see Handling and Raising Events.

El método OnNewRowNeeded también permite que las clases derivadas controlen el evento sin adjuntar ningún delegado.The OnNewRowNeeded method also allows derived classes to handle the event without attaching a delegate. Ésta es la técnica preferida para controlar el evento en una clase derivada.This is the preferred technique for handling the event in a derived class.

Notas a los desarrolladores de herederos

Al reemplazar OnNewRowNeeded(DataGridViewRowEventArgs) en una clase derivada, asegúrese de llamar al método OnNewRowNeeded(DataGridViewRowEventArgs) de la clase base para que los delegados registrados reciban el evento.When overriding OnNewRowNeeded(DataGridViewRowEventArgs) in a derived class, be sure to call the base class's OnNewRowNeeded(DataGridViewRowEventArgs) method so that registered delegates receive the event.

Se aplica a

Consulte también: