Hi!
I am working with a Silverlight application with some TimePicker controls and some TextBoxes. The XAML code like
<toolkit:TimePicker x:Name="time" Width="100" HorizontalAlignment="Left" Value="{Binding FromDatetime, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
<Button HorizontalAlignment="Left" Content="Button" Height="23" x:Name="button1" Width="75" Click="button1_Click" />
<TextBox Height="24" Name="text" Width="120" HorizontalAlignment="Left" Text="{Binding Path=FromDatetime, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True, ValidatesOnDataErrors=True}"/>
<sdk:ValidationSummary Name="errorSummary" />
My problem is, when i enter some invalid value and press the button (these is only a SubmitChanges() to a DataContext in my button1_Click handler), the TimePicker control don't show me any error message. In my case, I've tried 3 patterns.
- TimePicker control and Button
- TimePicker control, ValidationSummary, and Button
- TextBox and Button
- TextBox, ValidationSummary, and Button
The results are,
pattern 1: shows no error message and no red thin border around the TimePicker
pattern 2: the TimePicker is just the same as pattern 1, but ValidationSummary shows the error message
pattern 3: the TextBox shows error message and an red thin border
pattern 4: both the TextBox and the ValidationSummary show error message
So, how I can let the TimePicker show me the error message just like the TextBox?
Thanks.