Textbox editing right trim spaces

How can you set the textbox to ignore the spaces on the right. For example, in the screen shot below the data is padded right with spaces, to the max length of the field, and you must delete the spaces out before inserting text anywhere.

Edit

Maybe it will be better to handle this in your DbContext or model. You can check this thread for various approaches:

Messy. Seems easiest to change to varchar. Thank you Vladimir.