'Declaration Public Event SelectedRowsCollectionChanged As EventHandler(Of SelectionCollectionChangedEventArgs(Of SelectedRowsCollection))
public event EventHandler<SelectionCollectionChangedEventArgs<SelectedRowsCollection>> SelectedRowsCollectionChanged
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.
Property | Description |
---|---|
NewSelectedItems | A collection of items that are currently selected. |
PreviouslySelectedItems | A collection of items that were previously selected. |
AddHandler Me.MyGrid.SelectedRowsCollectionChanged, AddressOf MyGrid_SelectedRowsCollectionChanged Private Sub dataGrid_SelectedRowsCollectionChanged(ByVal sender As System.Object, ByVal e As SelectionCollectionChangedEventArgs(Of SelectedRowsCollection)) System.Diagnostics.Debug.WriteLine("Number of selected rows changed from " + e.PreviouslySelectedItems.Count.ToString() + " to " + e.NewSelectedItems.Count.ToString()) End Sub
this.MyGrid.SelectedRowsCollectionChanged += new EventHandler<SelectionCollectionChangedEventArgs<SelectedRowsCollection>>(MyGrid_SelectedRowsCollectionChanged); 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); }
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