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

Show validation error message on focus

3 Answers 691 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ken
Top achievements
Rank 1
Ken asked on 23 Aug 2016, 02:45 PM

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!

3 Answers, 1 is accepted

Sort by
0
Masha
Telerik team
answered on 25 Aug 2016, 07:14 AM
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.
0
Ken
Top achievements
Rank 1
answered on 25 Aug 2016, 08:45 AM

Hi Masha,

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

Cheers!

0
Masha
Telerik team
answered on 26 Aug 2016, 06:26 AM
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.
Tags
General Discussions
Asked by
Ken
Top achievements
Rank 1
Answers by
Masha
Telerik team
Ken
Top achievements
Rank 1
Share this question
or