DataGridView.AlternatingRowsDefaultCellStyleChanged Evento

Definição

Ocorre quando o valor da AlternatingRowsDefaultCellStyle propriedade muda.

public:
 event EventHandler ^ AlternatingRowsDefaultCellStyleChanged;
public event EventHandler AlternatingRowsDefaultCellStyleChanged;
member this.AlternatingRowsDefaultCellStyleChanged : EventHandler 
Public Custom Event AlternatingRowsDefaultCellStyleChanged As EventHandler 

Tipo de Evento

Exemplos

O seguinte exemplo de código demonstra a utilização deste elemento. No exemplo, um gestor de eventos reporta a ocorrência do AlternatingRowsDefaultCellStyleChanged evento. Este relatório ajuda-o a saber quando o evento ocorre e pode ajudá-lo na depuração. Para reportar múltiplos eventos ou eventos que ocorrem frequentemente, considere substituir MessageBox.Show ou Console.WriteLine anexar a mensagem a uma multilinha TextBox.

Para executar o código de exemplo, cole-o num projeto que contenha uma instância do tipo DataGridView chamada DataGridView1. Depois, certifique-se de que o gestor de eventos está associado ao AlternatingRowsDefaultCellStyleChanged evento.

private void DataGridView1_AlternatingRowsDefaultCellStyleChanged(Object sender, EventArgs e) {

   MessageBox.Show("You are in the DataGridView.AlternatingRowsDefaultCellStyleChanged event.");
}
Private Sub DataGridView1_AlternatingRowsDefaultCellStyleChanged(sender as Object, e as EventArgs) _ 
     Handles DataGridView1.AlternatingRowsDefaultCellStyleChanged

   MessageBox.Show("You are in the DataGridView.AlternatingRowsDefaultCellStyleChanged event.")

End Sub

Observações

Este evento ocorre quando qualquer propriedade do DataGridViewCellStyle devolvido AlternatingRowsDefaultCellStyle pela propriedade é definida para um novo valor ou quando a AlternatingRowsDefaultCellStyle propriedade é definida para um novo DataGridViewCellStyle com pelo menos um valor de propriedade diferente do objeto de estilo da célula anterior.

Para mais informações sobre como gerir eventos, consulte Gestão e Levantamento de Eventos.

Aplica-se a

Ver também