Show validation error message on focus

4 posts, 0 answers
  1. Ken
    Ken avatar
    104 posts
    Member since:
    Aug 2010

    Posted 23 Aug Link to this post

    Is there a way to make the validation error message for input controls in general (WatermarkedTextBox, NumericUpDown, MaskedInputs etc) appear on focus of the field? By default it appears on hovering over the small triangle in the upper-right corner of the control, when it's in the error state. This however is pretty hard for users to figure out and also sometimes to correctly "hit" with the mouse cursor.

    Thanks!

  2. Masha
    Admin
    Masha avatar
    355 posts

    Posted 25 Aug Link to this post

    Hello Ken,

    There is no easy way to achieve the desired approach. You need to modify the ValidationErrorTemplate to uses Popup instead of Tooltip and then apply it on desired controls. After-that you need to apply this error template for every input as follow:

    <Style TargetType="telerik:RadWatermarkTextBox" BasedOn="{StaticResource RadWatermarkTextBoxStyle}">
           <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorTemplate}" />
    </Style>
     
    <Style TargetType="TextBox" BasedOn="{StaticResource TextBoxStyle}">
          <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorTemplate}" />
    </Style>

    I created a sample demo how this should looks like. I hope this helps.


    Regards,
    Masha
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Ken
    Ken avatar
    104 posts
    Member since:
    Aug 2010

    Posted 25 Aug Link to this post

    Hi Masha,

    Thanks for the answer. I think you forgot to attach the sample demo, could you please attach it as well?

    Cheers!

  5. Masha
    Admin
    Masha avatar
    355 posts

    Posted 26 Aug Link to this post

    Hello Ken,

    I am sorry, there seems to be an issue with the attachment.  I have uploaded it again and it should be ok now.

    Regards,
    Masha
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top