Validation

4 posts, 0 answers
  1. Paul Ridden
    Paul Ridden avatar
    35 posts
    Member since:
    Mar 2007

    Posted 04 Aug 2010 Link to this post

    Hi

    I have a date/time picker (XAML below). Problems:

    1) When I type in 'hello' a tooltip appears with 'Error'. However I was expecting to see the red outline to the control and red tooltip as per other controls. ScheduleDate is a Nullable<DateTime>. Is this exected, and how can I get the normal error style?

    2) I am using MVVM so because the value is invalid as a date/time my ViewModel is not updated and I dont know anything is wrong. I would like to know as they type but ParseDateTimeValue is only raised on lost focus. How can I respond to the the text changing?

    <t:RadDateTimePicker Grid.Row="2" DateTimeWatermarkContent="" 
    SelectedValue="{Binding ScheduleDate, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}"
    Height="22" Margin="0,10,16,2" HorizontalAlignment="Stretch" />

    Thanks
    Russell Mason
  2. Dani
    Admin
    Dani avatar
    848 posts

    Posted 06 Aug 2010 Link to this post

    Hello Paul Ridden,

    Thank you for submitting your concerns.

    The display of the tooltip that you see is intended. This is not the regular Validation tooltip (which indeed is red with red foreground), but a Suggestion tooltip

    By default, text input is enabled for RadDateTimePicker, because you have the option to enter for instance "3 September" and the tooltip will update its value to suggest 9/3/2010.

    Additionally, the ParseDateTimeValue is raised on lost focus because text should be parsed after one has finished entering input and this is intended default behavior.
    We understand that such a behavior is not the optimal for your scenario and we will strive to improve the control validation in our upcoming releases (by the way, RadDateTimePicker is a new control from our Q2 Release). 

    What you could do for now is to create an attached behavior which sets the SelectedValue of RadDateTimePicker to null on some condition and as a result throw an exception whenever SelectedValue is null so that you will be able to see the Validation tooltip.

    Please, get back to us with any further questions.

    Sincerely yours,
    Dani
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Terry Foster
    Terry Foster avatar
    60 posts
    Member since:
    Sep 2009

    Posted 14 Aug 2010 Link to this post

    I, too, fully expect and need the control validation to behave similarly to when a TextBox bound to a number field (red outline, "Input is not in the correct format" error tip, and 'BindingValidationError' event raised).

    Thanks,
    Terry
  5. Dani
    Admin
    Dani avatar
    848 posts

    Posted 18 Aug 2010 Link to this post

    Hello Terry Foster, Paul Ridden,

    Since this issue has been requested a lot and we consider it significant to the proper functioning of the control, the feature is now implemented.

    As described in my previous post, SelectedValue of RadDateTimePicker will be set to null whenever invalid/dummy text has been entered. Consequently, you can use this behavior to throw an exception in that case and take advantage of the validation.

    The fix will be available in the next Latest Internal Build.


    Sincerely yours,
    Dani
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top