GridColumnStylesCollection.CollectionChanged Event

 

Occurs when a change is made to the GridColumnStylesCollection.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public event CollectionChangeEventHandler CollectionChanged

For more information about handling events, see NIB: Consuming Events.

The following code example adds a handler for the CollectionChanged event.

private void AddHandler() {
   GridColumnStylesCollection myGridColumns;
   myGridColumns = dataGrid1.TableStyles[0].GridColumnStyles;
   // Add the handler.
   myGridColumns.CollectionChanged += new 
      CollectionChangeEventHandler(GridCollection_Changed);
}

private void GridCollection_Changed
  (object sender, CollectionChangeEventArgs e) {
   GridColumnStylesCollection myGridColumns;
   myGridColumns = (GridColumnStylesCollection) sender;
   Console.WriteLine(myGridColumns.Count);
}       

.NET Framework
Available since 1.1
Return to top
Show: