If I understand your question correctly (you want to confirm your edit before applying your value to the grid), you should write a custom Editor for your code column. Then you have control absolute over user input.
You can also intercept all cell edits and have complete control over how and when those edits are committed by specifying a custom handler by setting the editCommandHandler grid option.
See this for further reference.