In order for the modifications to be committed (to the DataRow not the datasource) the DataRow's EndEdit method must be called. This method is automatically called when you click on another row.
If you want the modifications to be made when you click on a button for example, you can manually call EndEdit.
If the value entered is valid, it will be committed, if it was not, the EndEdit method will throw. You can handle the DataRowTemplate's ValidationError to prevent the DataRow from leaving edit mode in this case, otherwise the value will not be committed and the row will exit edit mode.
If you do not want the changes to be committed in the case where the user presses the button but EndEdit has not been called, then use the CancelEdit method instead.