Version

SelectedCellsCollectionChanged Event

The SelectedCellsCollectionChanged event is raised after a Cell has been added or removed to the SelectedCells collection.
Syntax
'Declaration
 
Public Event SelectedCellsCollectionChanged As EventHandler(Of SelectionCollectionChangedEventArgs(Of SelectedCellsCollection))
Event Data

The event handler receives an argument of type SelectionCollectionChangedEventArgs<T> containing data related to this event. The following SelectionCollectionChangedEventArgs<T> properties provide information specific to this event.

PropertyDescription
NewSelectedItems A collection of items that are currently selected.
PreviouslySelectedItems A collection of items that were previously selected.
Example
This sample demonstrates how to handle the SelectionCellsCollectionChanged event which is fired when a cell has been added to or removed from the SelectedCells collection.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

AddHandler Me.MyGrid.SelectedCellsCollectionChanged, AddressOf MyGrid_SelectedCellsCollectionChanged

Private Sub MyGrid_SelectedCellsCollectionChanged(ByVal sender As System.Object, ByVal e As SelectionCollectionChangedEventArgs(Of SelectedCellsCollection))
   System.Diagnostics.Debug.WriteLine("Number of selected cells changed from " + e.PreviouslySelectedItems.Count.ToString() + " to " + e.NewSelectedItems.Count.ToString())
End Sub
this.MyGrid.SelectedCellsCollectionChanged += new EventHandler<SelectionCollectionChangedEventArgs<SelectedCellsCollection>>(MyGrid_SelectedCellsCollectionChanged);

void MyGrid_SelectedRowsCollectionChanged(object sender, SelectionCollectionChangedEventArgs<SelectedRowsCollection> e)
{
    System.Diagnostics.Debug.WriteLine("Number of selected rows changed from " + e.PreviouslySelectedItems.Count + " to " + e.NewSelectedItems.Count);
}
<ig:XamGrid x:Name="MyGrid"
   
SelectedCellsCollectionChanged="MyGrid_SelectedCellsCollectionChanged">
</ig:XamGrid>
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also