Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
320
How to show error info on xamtexteditor
posted

Hi 

Below is my Xaml

I implemeneted IDataErrorInfo Interface and I return string when error comes. But I am unable to see error message. I am able see text box is highlighted when error comes.

So how to show error message on textbox as a tooltip or any other format.

 

  • 34810
    Offline posted

    Hello Yugandhar,

    Unfortunately, I am unable to see the XAML that you had pasted, but I have put together a sample project in which the IDataErrorInfo interface is implemented with the XamTextEditor.

    In order to show the error message in a tooltip, I would recommend binding your Tooltip property using a RelativeSource Self binding to the attached Validation.Errors property on the XamTextEditor. You can index into this collection, and then show the ErrorContent of your error, which will be the string you are returning. The binding for this could look like the following:

    Tooltip="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}"

    I have attached a sample project to demonstrate the above. I hope this helps.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer

    XamTextEditorDataErrorCase.zip