This is a migrated thread and some comments may be shown as answers.

RadMaskedDateTimeInput control not displaying value properly

2 Answers 120 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Tony
Top achievements
Rank 1
Tony asked on 06 Nov 2012, 09:09 PM
I've got a RadMaskedDateTimeInput control in my application:
<telerik:RadMaskedDateTimeInput BorderBrush="{Binding Path=BorderBrush, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        FlowDirection="{Binding Path=FlowDirection, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        Focusable="True"
                                        FontFamily="{Binding Path=FontFamily, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        FontSize="{Binding Path=FontSize, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        FontStretch="{Binding Path=FontStretch, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        FontStyle="{Binding Path=FontStyle, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        FontWeight="{Binding Path=FontWeight, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        GotFocus="ValueBox_GotFocus"
                                        Grid.Column="0"
                                        FormatString="{Binding Path=Mask, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        HorizontalAlignment="Stretch"
                                        HorizontalContentAlignment="Right"
                                        InputBehavior="Insert"
                                        IsClearButtonVisible="False"
                                        LostFocus="ValueBox_LostFocus"
                                        Margin="5"
                                        Mask="{Binding Path=Mask, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        Name="ValueBox"
                                        SelectionOnFocus="CaretToEnd"
                                        SpinMode="PositionAndValue"
                                        TabIndex="{Binding Path=TabIndex, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        TextMode="MaskedText"
                                        UpdateValueEvent="PropertyChanged"
                                        Value="{Binding Converter={StaticResource TimeSpanConverter}, Path=Value, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}, UpdateSourceTrigger=PropertyChanged}"
                                        VerticalAlignment="Center" />

This is actually inside of a UserControl.  That user control is then used in another UserControl that is used to edit user settings.  The first UserControl is supposed to provide spinner functionality for specifying a time out interval on a touch screen computer.  There are two big buttons next to the RadMaskedDateTimeInput control, one for increasing the value and one for decreasing it.  Since the value is a time out, the data type of the variable being edited is TimeSpan, and I want to see the text formatted as HH:mm:ss.fff.  That's what the Mask property is set to, and the FormatString is set to that, too.

The control displays correctly until I put the cursor in it.  At that point, the HH:mm:ss.fff formatting goes away and I see 01/01/0001.  This is useless.  This did work properly at one time, but now it's broken and I don't know why.  Why is the control ignoring the input mask???

I'm using the 2012 Q1 version of the library.

2 Answers, 1 is accepted

Sort by
0
Accepted
Pavel R. Pavlov
Telerik team
answered on 08 Nov 2012, 04:55 PM
Hello Tony,

I tried to reproduce your issue with our latest release and it seems that the code works as expected (see the attached project). Can you please upgrade your version and try to reproduce it after that?

All the best,
Pavel R. Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Tony
Top achievements
Rank 1
answered on 07 Dec 2012, 03:04 PM
Upgrading to the most recent version of the library did fix this issue.

Thanks!
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Tony
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Tony
Top achievements
Rank 1
Share this question
or