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 7973741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:11:30+00:00 2026-06-04T08:11:30+00:00

I want to fire more than one validation on the same element. I found

  • 0

I want to fire more than one validation on the same element. I found code but I do not understand in which situation which validation fire. The xaml code is as follows:

<ComboBox 
            x:Name="CreditedParty"
            Style="{StaticResource FormControlStyle}"
            Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2"
            ItemsSource="{Binding CreditedParties}"
            SelectedItem="{Binding Amount, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}"
            DisplayMemberPath="Name"/>
        <ContentPresenter 
            Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2"
            Content="{Binding ElementName=CreditedParty, Path=(Validation.Errors).CurrentItem}"/>

the code for vtewmodel.cs file is as follows:

   public string Error
    {
        get { return (_debitNote as IDataErrorInfo).Error; }
    }

    public string this[string columnName]
    {
        get
        {
            string error = null;

            if (columnName == "Amount")
            {
                decimal amount;

                error = ValidateAmount(out amount);
                if (!string.IsNullOrEmpty(error)) return error;

                _debitNote.Amount = amount;
                error = (_debitNote as IDataErrorInfo)["Amount"];
            }
            else if (columnName == "CreditedParty")
            {
                error = ValidateCreditedParty();
                if (!string.IsNullOrEmpty(error)) return error;
                error = (_debitNote as IDataErrorInfo)["CreditedParty"];
            }
            else if (columnName == "DebitedParty")
            {
                error = ValidateDebitedParty();
                if (!string.IsNullOrEmpty(error)) return error;
                error = (_debitNote as IDataErrorInfo)["DebitedParty"];
            }
            else
            {
                error = (_debitNote as IDataErrorInfo)[columnName];
            }

            CommandManager.InvalidateRequerySuggested();

            return error;
        }
    }

    private string ValidateAmount(out decimal amount)
    {
        amount = -1;
        string error = null;

        if (string.IsNullOrEmpty(_amountString))
            error = Strings.JournalViewModel_Amount_Missing;
        else if (!decimal.TryParse(_amountString, out amount))
            error = Strings.JournalViewModel_Amount_NaN;

        return error;
    }

    private string ValidateCreditedParty()
    {
        string error = null;

        if (_debitNote.CreditedParty == _blankCreditedParty)
            error = Strings.JournalViewModel_CreditedParty_NotSpecified;

        return error;
    }

    private string ValidateDebitedParty()
    {
        string error = null;

        if (_debitNote.DebitedParty == _blankDebitedParty)
            error = Strings.JournalViewModel_DebitedParty_NotSpecified;

        return error;
    }

    #endregion

How does this code fire more than one validation? Can any one answer.

  • 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-04T08:11:32+00:00Added an answer on June 4, 2026 at 8:11 am

    Fire PropertyChanged event to trigger validation.

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

Sidebar

Related Questions

I want to make use of complex usercontrols with more than one control element
I have one Application which has more then 5 Activity I want to know
I want to let TextBox control TextChanged event fire only when there are more
i want to fire an event manually using c#. For instance, say if i
Onsubmit I want to fire fancybox popup I need only to show the fancybox
I have a periodically_call_remote that I want to fire right away (as if the
I have several sql queries that I simply want to fire at the database.
I have a Data grid with DatagridComboBoxColumn , and i want to Fire Event
i have 2 divs next to each other i want mouseleave to fire when
I want to have a generic event that I can fire that will take

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.