DataGrid.SelectedCellsChanged
provide youに必要なものを使用してください。
private void DG1_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
{
//Get the newly selected cells
IList<DataGridCellInfo> selectedcells = e.AddedCells;
//Get the value of each newly selected cell
foreach (DataGridCellInfo di in selectedcells)
{
//Cast the DataGridCellInfo.Item to the source object type
//In this case the ItemsSource is a DataTable and individual items are DataRows
DataRowView dvr = (DataRowView)di.Item;
//Clear values for all newly selected cells
AdventureWorksLT2008DataSet.CustomerRow cr = (AdventureWorksLT2008DataSet.CustomerRow)dvr.Row;
cr.BeginEdit();
cr.SetField(di.Column.DisplayIndex, "");
cr.EndEdit();
}
}
アーロンの権利。 SelectionChangedは実際に動作し、必要な情報を提供します。 – GuYsH