It's a bad idea to work that way.
You're far better off with a button separate to the datagrid so you force the datagrid to lose focus and ensure any edits are committed.
It's a bad idea to work that way.
You're far better off with a button separate to the datagrid so you force the datagrid to lose focus and ensure any edits are committed.