Hi @Mansour_Dalir ,
When you turn on sorting, exiting edit mode triggers automatic sorting, which is the expected result.
If you want it to sort automatically and not trigger sorting after you modify the cell contents, then you may need to disable sorting in DataGridView.CellEndEdit Event and then use your button to re-enable sorting.
Best Regards.
Jiachen Li
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.