DataGridViewRowsAddedEventHandler Delegado

Definición

Representa el método que controlará el evento RowsAdded de DataGridView.Represents the method that will handle the RowsAdded event of a DataGridView.

public delegate void DataGridViewRowsAddedEventHandler(System::Object ^ sender, DataGridViewRowsAddedEventArgs ^ e);
public delegate void DataGridViewRowsAddedEventHandler(object sender, DataGridViewRowsAddedEventArgs e);
type DataGridViewRowsAddedEventHandler = delegate of obj * DataGridViewRowsAddedEventArgs -> unit
Public Delegate Sub DataGridViewRowsAddedEventHandler(sender As Object, e As DataGridViewRowsAddedEventArgs)

Parámetros

sender
Object

Origen del evento.The source of the event.

e
DataGridViewRowsAddedEventArgs

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

Herencia
DataGridViewRowsAddedEventHandler

Ejemplos

En el ejemplo de código siguiente DataGridViewRowsAddedEventHandler se usa un en modo virtual para almacenar el hecho de que se ha agregado una fila.The following code example uses a DataGridViewRowsAddedEventHandler in virtual mode to store the fact that a row has been added. Este ejemplo forma parte de un ejemplo más grande disponible en VirtualMode el tema de referencia.This example is part of a larger example available in the VirtualMode reference topic.

void VirtualConnector::dataGridView1_RowsAdded
    (Object^ sender, DataGridViewRowsAddedEventArgs^ e)
{
    if (newRowNeeded)
    {
        newRowNeeded = false;
        numberOfRows = numberOfRows + 1;
    }
}
private void dataGridView1_RowsAdded(object sender,
     DataGridViewRowsAddedEventArgs e)
{
    if (newRowNeeded)
    {
        newRowNeeded = false;
        numberOfRows = numberOfRows + 1;
    }
}
Private Sub dataGridView1_RowsAdded(ByVal sender As Object, _
    ByVal e As DataGridViewRowsAddedEventArgs) _
    Handles dataGridView1.RowsAdded

    If newRowNeeded Then
        newRowNeeded = False
        numberOfRows = numberOfRows + 1
    End If
End Sub

Comentarios

El RowsAdded evento tiene lugar cuando se agregan filas DataGridView a un control.The RowsAdded event occurs when rows are added to a DataGridView control.

Cuando se crea un delegado DataGridViewRowsAddedEventHandler, se identifica el método que controlará el evento.When you create a DataGridViewRowsAddedEventHandler delegate, you identify the method that will handle the event. Para asociar el evento al controlador, se debe agregar una instancia del delegado al evento.To associate the event with your event handler, add an instance of the delegate to the event. Siempre que se produce el evento, se llama a su controlador, a menos que se quite el delegado.The event handler is called whenever the event occurs, unless you remove the delegate. Para obtener más información sobre los delegados de controladores de eventos, vea controlar y provocar eventos.For more information about event-handler delegates, see Handling and Raising Events.

Métodos de extensión

GetMethodInfo(Delegate)

Obtiene un objeto que representa el método representado por el delegado especificado.Gets an object that represents the method represented by the specified delegate.

Se aplica a

Consulte también: