'宣言 Public Event SelectedCellsCollectionChanged As EventHandler(Of SelectionCollectionChangedEventArgs(Of SelectedCellsCollection))
public event EventHandler<SelectionCollectionChangedEventArgs<SelectedCellsCollection>> SelectedCellsCollectionChanged
イベント ハンドラが、このイベントに関連するデータを含む、SelectionCollectionChangedEventArgs<T> 型の引数を受け取りました。次の SelectionCollectionChangedEventArgs<T> プロパティには、このイベントの固有の情報が記載されます。
プロパティ | 解説 |
---|---|
NewSelectedItems | 現在選択されている項目のコレクションです。 |
PreviouslySelectedItems | 以前選択された項目のコレクションです。 |
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); }