GridTableStylesCollection.CollectionChanged Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Occurs when the collection has changed.
public:
event System::ComponentModel::CollectionChangeEventHandler ^ CollectionChanged;
public event System.ComponentModel.CollectionChangeEventHandler CollectionChanged;
member this.CollectionChanged : System.ComponentModel.CollectionChangeEventHandler
Public Custom Event CollectionChanged As CollectionChangeEventHandler
Event Type
Examples
The following code example adds a CollectionChangeEventHandler delegate to a CollectionChanged event.
private:
void AddHandler()
{
dataGrid1->TableStyles->CollectionChanged +=
gcnew CollectionChangeEventHandler( this, &Form1::Collection_Changed );
}
void Collection_Changed( Object^ sender, CollectionChangeEventArgs^ e )
{
GridTableStylesCollection^ gts = (GridTableStylesCollection^)(sender);
Console::WriteLine( gts->Count );
}
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);
}
Private Sub MyAddHandler()
AddHandler dataGrid1.TableStyles.CollectionChanged, _
AddressOf Collection_Changed
End Sub
Private Sub Collection_Changed _
(sender As Object, e As CollectionChangeEventArgs)
Dim gts As GridTableStylesCollection = _
CType(sender, GridTableStylesCollection)
Console.WriteLine(gts.Count)
End Sub
Remarks
For more information about handling events, see Handling and Raising Events.
Applies to
Sodelujte z nami v storitvi GitHub
Vir za to vsebino najdete v storitvi GitHub, kjer lahko tudi ustvarite in pregledate težave in zahtevke za uveljavitev sprememb. Če želite več informacij, glejte naš vodnik za sodelavce.