バージョン 24.2 (最新)

OnRecordsDeleted メソッド

1 つまたは複数の DataRecord が削除された後に発生します。
シンタックス
protected virtual void OnRecordsDeleted( 
   RecordsDeletedEventArgs args
)

パラメータ

args
解説

DataRecord の削除は System.ComponentModel.IBindingList インターフェイスを実装し、その System.ComponentModel.IBindingList.AllowRemove プロパティから true を返す DataSource にサポートされています。また、System.Collections.IList インターフェイスを実装し、その System.Collections.IList.IsReadOnly プロパティおよび System.Collections.IList.IsFixedSize プロパティ両方から false を返す DataSource にもサポートされています。

DataRecord の削除が有効になっているという前提で、ユーザーが 1 つまたは複数の DataRecord を選択し、Delete キーを押すと、RecordsDeleting イベントおよび RecordsDeleted イベントが発生します。DataRecord も、まず (Record.IsSelected プロパティまたは SelectedItems コレクション経由で) それらを選択し DataPresenterCommands.DeleteSelectedDataRecords コマンドで ExecuteCommand(RoutedCommand) を呼び出してプログラムで削除できます。

注: レコードの削除はデフォルトで有効になっています。レコードの削除を無効にするには、FieldLayoutSettingsFieldLayoutSettings.AllowDelete プロパティを False に設定します。

参照