1. Use DataView to bind DataGrid, do not use DataTable
2. Locate the cursor to the current line before deleting the update. Because the user may click on a record first, then click on the line, the record in the detailed list is the record before sort, and the current line is a recorded record. Moreover, the sort property is not changed in the MouseUp event, and is reset after the MouseUp event. If the Sort property is forced to change in the mouseup, the result of MouseUp will still be set by default. So only when you modify and delete it, you are positioned to the current line.