We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

MaskedTextBox Binding problem

Thread ID:

Created:

Updated:

Platform:

Replies:

100406 Aug 4,2011 02:10 PM UTC Aug 8,2011 03:07 PM UTC WPF 1
loading
Tags: Tools
Richard Tang
Asked On August 4, 2011 02:10 PM UTC

I two way bind DateTime value to the MaskedTextBox, but the value did not show up in the Box.

Text='{Binding Path=StartTime, StringFormat='{}{0:MM/dd/yyyy, hh:mm}'}'
Mask='00/00/0000, 00:00' Foreground='White'
LostFocus='MaskedTextBox_LostFocus' />




Michel Cossette
Replied On August 8, 2011 03:07 PM UTC

Try binding the 'Value' instead of the 'Text' property, as:

Value='{Binding Path=StartTime, StringFormat='{}{0:MM/dd/yyyy, hh:mm}'}'
Mask='00/00/0000, 00:00' Foreground='White'
LostFocus='MaskedTextBox_LostFocus' />




CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;