GridTableStylesCollection.CollectionChanged Event

 

Occurs when the collection has changed.

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

public event CollectionChangeEventHandler CollectionChanged

For more information about handling events, see Handling and Raising Events.

The following code example adds a CollectionChangeEventHandler delegate to a CollectionChanged event.

private void AddHandler()
{
   dataGrid1.TableStyles.CollectionChanged += 
   new CollectionChangeEventHandler(Collection_Changed);
}

private void Collection_Changed
(object sender, CollectionChangeEventArgs e)
{
   GridTableStylesCollection gts = (GridTableStylesCollection)
   sender;
   Console.WriteLine(gts.Count);
}

.NET Framework
Available since 1.1
Return to top
Show: