user2740190
user2740190

Reputation:

Getting the time part of a DateTime and feeding it to a Masked Text box

My XAML coverter for my time field on the form return some "DateTime" object like this:

protected override DateTime? OnConvert(string value, Type targetType, object parameter, CultureInfo culture)

{01/30/14 3:00:00 PM}

which my Telerik Timepicker will show its time part. Everything good!. Now I also have a "Masked Text Box" on the same form that is showing the same Time as the time above. ( this one a read only one and it is a masked textbox not a DateTime pikcer control like before) so it expects "String" ... my Converter is returning "DateTime" and the mask is like "##:## aa" Currently with the example DateTime above the mask is showing "01:30 /1"

So now I am looking for a way to: get the time part of that result and give it to MaskedTextBox so it can still display it correctly.

Upvotes: 0

Views: 602

Answers (1)

phoog
phoog

Reputation: 43046

I assume this is the Telerik RadMaskedTextBox. In that case, you should set the MaskType property to DateTime (see http://www.telerik.com/help/silverlight/working_with_radmaskedtextbox.html). The valid DateTime masks are described at http://www.telerik.com/help/silverlight/radmaskedtextbox-features-date-time-mask.html.

Upvotes: 1

Related Questions