Validation Adornment and Collapsed Expander

4 posts, 1 answers
  1. Reilly
    Reilly avatar
    22 posts
    Member since:
    Oct 2012

    Posted 13 Apr 2018 Link to this post

    In the attached very simple project, the main window has a single RadExpander containing a single RadNumericUpDown control. The Viewmodel adds a validation rule which always sets the only property (MyValue) as failed. (I tried to attach files but your system no longer lets me!)

    When the RadExpander.IsExpanded property is set to false (as in the attached code), and you then expand it, you'll see the RadNumericUpDown appears normally, without any validation error adornment.

    If you change RadExpander.IsExpanded property in the xaml to true and you run, you'll see the RadNumericUpDown has the validation error adornment and shows the error tooltip.

    Why? If you use either Snoop or the VS tools, you'll see that the RadNumericUpDown has the error in both cases.

    I'm using 2017.3.1018.45 on Win 10 x64.

    Thanks.

    -John.

     

  2. Answer
    Martin Ivanov
    Admin
    Martin Ivanov avatar
    2214 posts

    Posted 18 Apr 2018 Link to this post

    Hi John,

    I cannot see any attachments to your reply. Please note that the forum allows you to attach only pictures. In the general case to attach a project you can open a new support ticket from your telerik.com account. 

    As for your scenario, may I ask you to prepare some runnable code snippets and post them here? This will allow me to get a better idea of your case and investigate what is going on. 

    Thank you for any help you can provide.

    Regards,
    Martin Ivanov
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  3. Reilly
    Reilly avatar
    22 posts
    Member since:
    Oct 2012

    Posted 18 Apr 2018 Link to this post

    Hi Martin,

    Thanks for responding. I can't open a new support ticket to attach the sample project; I don't have support.

    But it doesn't matter, as I found the solution.

    I found that the stock WPF Expander widget also exhibits this behavior. So I googled it. Of course StackOverflow had addressed it:

       https://stackoverflow.com/questions/10978222/wpf-expander-validation-error-not-shown-when-expanded

    In short, this is known behavior. The workaround is to wrap the control (i.e. RadNumericUpDown) inside of an AdornerDecorator element. I don't understand WPF well enough to know why this is necessary, but it fixes the problem.

    Thanks.

    -John.

  4. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2214 posts

    Posted 18 Apr 2018 Link to this post

    Hello John,

    Thank you for sharing your solution here.

    Regards,
    Martin Ivanov
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top