Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 413785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:13:06+00:00 2026-05-12T18:13:06+00:00

I’m trying to find a simple way of binding a single control (eg. TextBlock

  • 0

I’m trying to find a simple way of binding a single control (eg. TextBlock or ListBox) to list all the validation errors on a WPF form. Most source code examples I have been able to find just bind a control to (Validation.Errors)[0].ErrorContent which only shows a single validation error.

I’m currently using ValidationRule classes, though I’m open to using IDataErrorInfo, or building a custom validator. I’m just not sure how to accomplish what I would expect to be a common use-case.

How do I list all validation errors in one control on a WPF form?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T18:13:06+00:00Added an answer on May 12, 2026 at 6:13 pm

    I don’t think you can do anything like this using (Validation.Errors) binding. The reason is that Validation attached property provides one-to-one relationship between a bound control and an adorner site, so you just cannot combine validation errors from different controls in one adorner – the last one would always “take over” the site. BTW, I have no idea why Validation.Errors is an array – maybe for multiple errors from the same control?

    But there is still hope – you have at least two ways to solve this, without using validation adorners.

    The first one is simple as a nail – if you use IDataErrorInfo, you have some mechanism for checking the bound values of your object for validity. You could then write something along the lines of

    public IEnumerable<string> CombinedErrors
    {
        get { 
               if (FirstValError) yield return "First value error"; 
               if (SecondValError) yield return "Second value error"; 
            }
    }
    

    and bind some ItemsControl to the CombinedErrors property

    The second one would involve setting NotifyOnValidationError=True on each binding (to raise Validation.Error routed event) and catch this event on the top container:

    public List<ValidationError> MyErrors { get; private set; }
    
    private void Window_Error(object sender, 
        System.Windows.Controls.ValidationErrorEventArgs e)
    {
        if (e.Action == ValidationErrorEventAction.Added)
            MyErrors.Add(e.Error);
        else
            MyErrors.Remove(e.Error);
    }
    

    then you can bind these similarly to any ItemsControl.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to render a haml file in a javascript response like so:
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.