WPF DataGrid: How to Determine the Current Row Index?
问题 I am trying to implement a very simple spreadsheet functionality based on a DataGrid. The user clicks on a cell The user types a value and presses return The current row is scanned and any cell formula that depends on the clicked cell is updated. This seems to be the best event handler for my requirements: private void my_dataGrid_CurrentCellChanged(object sender, EventArgs e) Question: How do I detect the row index of the current row? 回答1: Try this (assuming the name of your grid is "my