BindingSource.ListChanged Evento
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Si verifica quando l'elenco sottostante cambia o un elemento nell'elenco cambia.
public:
virtual event System::ComponentModel::ListChangedEventHandler ^ ListChanged;
public event System.ComponentModel.ListChangedEventHandler ListChanged;
public event System.ComponentModel.ListChangedEventHandler? ListChanged;
member this.ListChanged : System.ComponentModel.ListChangedEventHandler
Public Custom Event ListChanged As ListChangedEventHandler
Tipo evento
Implementazioni
Esempio
Nell'esempio di codice seguente viene illustrata la gestione dell'evento ListChanged del BindingSource componente da rilevare quando viene modificato l'elenco BindingSource sottostante del componente.
// This event handler detects changes in the BindingSource
// list or changes to items within the list.
void customersBindingSource_ListChanged(
Object^ /*sender*/,
ListChangedEventArgs^ e )
{
status->Text = e->ListChangedType.ToString();
}
// This event handler detects changes in the BindingSource
// list or changes to items within the list.
void customersBindingSource_ListChanged(
object sender,
ListChangedEventArgs e)
{
status.Text = e.ListChangedType.ToString();
}
' This event handler detects changes in the BindingSource
' list or changes to items within the list.
Private Sub customersBindingSource_ListChanged(ByVal sender As Object, _
ByVal e As ListChangedEventArgs) Handles customersBindingSource.ListChanged
status.Text = e.ListChangedType.ToString()
End Sub
Commenti
L'evento ListChanged si verifica quando viene apportata una modifica all'appartenenza o ai metadati dell'elenco sottostante rappresentato dalla List proprietà . Questo evento, ad esempio, viene generato quando gli elementi vengono aggiunti, rimossi o spostati oppure le DataSource proprietà o DataMember cambiano. I valori delle Sort proprietà e Filter verranno mantenuti quando si verifica questo evento.
Questo evento può essere eliminato completamente impostando la RaiseListChangedEvents proprietà su false. Per ulteriori informazioni sulla gestione degli eventi, consultare gestione e generazione di eventi.