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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:46:21+00:00 2026-05-16T06:46:21+00:00

in my scenario I have a Linq2SQL Data backend. my Dataobjects implement IDataErrorInfo to

  • 0
  • in my scenario I have a Linq2SQL Data backend.
  • my Dataobjects implement IDataErrorInfo to catch errors like Name==null (fast to execute Validationrules that only require the value, nothing special so far )

  • the Dataobjects are organized in a tree-structure, so each has a Parent and Children

How can I validate if a chosen Name is Unique under the Children of a Dataobjects’ Parent?

The problem I’m facing is, that the unique Name validation requires a Database roundtrip which lags typing if UpdateSourceTrigger="PropertyChanged" on the TextBox binding to the Name.

On the other hand, I could set UpdateSourceTrigger="LostFocus", but the problem with that is, that I enable/disable a “Save” button on valid/invalid data. Now in the invalid state you can’t click the Save button, so there’s no way the Textbox could lose Focus to update (only tabbing away which is ugly, but there are more “unusabilities” with LostFocus (e.g. Error keeps displaying while typing and thus changing the name).

what would be ideal was a way to say for individual validationrules to apply on different events like so:

<TextBox Grid.Column="1">
    <TextBox.Text>
        <Binding Path="Foldername">
            <Binding.ValidationRules>
                <wpfresources:UniqueChildValidationRule ValidationStep="UpdatedValue" **UpdateSourceTrigger="LostFocus"**>
                    ... stuff here ...
                </wpfresources:UniqueChildValidationRule>
                <DataErrorValidationRule **UpdateSourceTrigger="PropertyChanged"**/>
            </Binding.ValidationRules>
        </Binding>
    </TextBox.Text>
</TextBox>

What is the best way to solve this?

EDIT

This MSDN article seems to suggest, that a BindingGroup would be the way to go. I’ll look into that…

  • 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-16T06:46:22+00:00Added an answer on May 16, 2026 at 6:46 am

    I finally figured a way to accomplish what I wanted.

    The use of BindingGroup worked, but I stripped my solution down because what I needed essentially was a way to show a Validationerror in the correct Textbox.

    I did so now with an attached property that I read out on execution of the “save”-functionality. then I manually validate and set a ValidationError on the textbox. that way the textbox can keep its PropertyChanged UpdateSourceTrigger and the lengthy validation is done on submit.

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

Sidebar

Related Questions

Scenario: I have imported the data from SQl Server to HDFS. The data stored
Scenario: I have an application that pulls data from a SQL database as well
I use Repository pattern (and linq2sql as data access) and have, for example, ProductsRep
Scenario I have an web application which needs some calculations and processing on data.
Scenario: I have an ajax autocomplete lookup that grabs data from a memory cache.
Scenario: I have 1 columns in my select statement; Name which I want to
Beginner level question Scenario: Have simple string cocantation tool, that I might expand later
SCENARIO I have to access a web service with a .NET client. The service
Scenario: I have a console application that needs to access a network share with
Scenario: I have an outline where I have links for my menu. Each link

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.