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

  • Home
  • SEARCH
  • 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 8493119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:55:09+00:00 2026-06-10T22:55:09+00:00

I am using WinForms in .NET and DevExpress 3rd Party Components. How can I

  • 0

I am using WinForms in .NET and DevExpress 3rd Party Components.
How can I validate the data of multiple components in a Form and summarize them in a customized way?

  • 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-06-10T22:55:11+00:00Added an answer on June 10, 2026 at 10:55 pm

    Try this code:

    using DevExpress.XtraEditors.DXErrorProvider;
    
    // ...
    ConditionValidationRule containsValidationRule = new ConditionValidationRule();
    containsValidationRule.ConditionOperator = ConditionOperator.Contains;
    containsValidationRule.Value1 = '@';
    containsValidationRule.ErrorText = "Please enter a valid email";
    containsValidationRule.ErrorType = ErrorType.Warning;
    
    CompareAgainstControlValidationRule compValidationRule = 
        new CompareAgainstControlValidationRule();
    compValidationRule.Control = notEmptyTextEdit;
    compValidationRule.CompareControlOperator = CompareControlOperator.Equals;
    compValidationRule.ErrorText = "Please enter a value that equals to the first editor's value";
    compValidationRule.CaseSensitive = true;
    
    CustomValidationRule customValidationRule = new CustomValidationRule();
    customValidationRule.ErrorText = "Please enter a valid person name";
    customValidationRule.ErrorType = ErrorType.Warning;
    
    dxValidationProvider1.SetValidationRule(containsTextEdit, containsValidationRule);
    dxValidationProvider1.SetValidationRule(compareTextEdit, compValidationRule);
    dxValidationProvider1.SetValidationRule(customTextEdit, customValidationRule);
    
    // Represents a custom validation rule.
    public class CustomValidationRule : ValidationRule {
        public override bool Validate(Control control, object value) {
            string str = (string)value;
            string[] values = new string[] { "Dr.", "Mr.", "Mrs.", "Miss", "Ms." };
            bool res = false;
            foreach(string val in values) {
                if(ValidationHelper.Validate(str, ConditionOperator.BeginsWith, 
                    val, null, null, false)) {
                    string name = str.Substring(val.Length);
                    if(name.Trim().Length > 0) res = true;
                }
            }
            return res;
        }
    }
    

    Source: http://documentation.devexpress.com/#WindowsForms/CustomDocument9481

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

Sidebar

Related Questions

I have build application using .NET 4.0, WinForms and DevExpress Winforms components. I have
I am currently programming within Visual Studio 2010 using VB.Net and DevExpress V10.2 Winforms.
I'm currently using winforms databinding to wire up a data editing form. I'm using
Win 7/SolrNet 0.4.0/C# winforms .net 4.0 client. I am using Solrnet and a winforms
I have a .net winforms ListBox and I've added items to it using .Add().
I am trying to send mail using SmtpClient() within my Winforms VB.Net program Here
I'm using JScript.NET to write scripts in a C# WinForms application I wrote. It
Using: Microsoft SQL Server 2008 Microsoft Visual Studio 2010 C# .NET 4.0 WinForms Ok
I'm writing a winforms application in C# (.NET 4.0, using EntityFramework). I wanted to
I'm implementing a scatter plot using the MS Chart Control .NET 3.5, WinForms, C#.

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.