ListChanged Event
Collapse the table of content
Expand the table of content

DataView.ListChanged Event


Occurs when the list managed by the DataView changes.

Namespace:   System.Data
Assembly:  System.Data (in System.Data.dll)

public event ListChangedEventHandler ListChanged

The following example adds a handler for the ListChanged event of a DataView.

public void CreateDataView(DataTable table) 
    DataView view = new DataView(table, "", 
        "ContactName", DataViewRowState.CurrentRows);

    view.ListChanged  += new 

private void OnListChanged(object sender, 
    System.ComponentModel.ListChangedEventArgs args)
    Console.WriteLine("\table    Type = " + args.ListChangedType);
    Console.WriteLine("\tOldIndex = " + args.OldIndex);
    Console.WriteLine("\tNewIndex = " + args.NewIndex);

.NET Framework
Available since 1.1
Return to top
© 2015 Microsoft