How do I trigger all Validating/Validated events on all controls on a form?

Posted on 2006-03-28
Last Modified: 2010-04-16

I am using my Validated events to move data from my form to the class object containing my data.  When the "Save" button is clicked, I want to make certain that all the Validated events have been triggered.  There are some test fields that just have data put into them as a result of choices being made on other controls.

So I'd like to build a method that just triggers the Validating event for all the controls, and if the control validates, trigger the Validated event.

The method would look something like this:

static public void TriggerValidations(Control.ControlCollection pcb)
      foreach (Control ctl in pcb)
                // trigger Validating event
                // if control Validated without error
                         //trigger Validated event

Is this possible?
Question by:FrancineTaylor
    1 Comment
    LVL 6

    Accepted Solution


    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
    Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now