Hi Michael,
Thank you for posting in the community! My name is Jeffrey, and I will be
assisting you on this issue.
Based on my understanding, you do simple databinding with textbox's Text
propety. But the changed value will immediately update the source
datasource without validate, so you want to validate the data before change
the datasource.
====================================================
Based on my experience, you may use TextBox.Validating event to hook into
the update process.
The Validating event takes a CancelEventArgs, which has one property:
Canel. You can check the updating value in the textbox and if the data is
invalid just set CancelEventArgs.Canel to true. This will prevent the
source from updating.
I have made a test project and it works well.
====================================================
Please apply my suggestion above and let me know if it helps resolve your
problem.
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.
Have a nice day!!
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.