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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:42:22+00:00 2026-05-26T11:42:22+00:00

When SelectedItem.DT throws an error Validation_Error is not called? DT is a DataTable from

  • 0

When SelectedItem.DT throws an error Validation_Error is not called? DT is a DataTable from a SQL query and I want to display the SQL error if the TSQL fails. I guess I could build a DataTable and put the ex.msg in the table. But I would rather call Validation_Error.

    <DataGrid Grid.Row="1" Grid.Column="0" AutoGenerateColumns="True"  
              ItemsSource="{Binding ElementName=cbReports, Path=SelectedItem.DT, ValidatesOnExceptions=True, NotifyOnValidationError=True, NotifyOnSourceUpdated=True}"
              Validation.Error="Validataion_Error" />

This TextBox (on another page) does call Validation_Error when an error is thrown in set.

    <TextBox Text="{Binding Path=DF.FieldValue, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}"
             Validation.Error="Validataion_Error"/>
  • 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-26T11:42:23+00:00Added an answer on May 26, 2026 at 11:42 am

    DataTable is not implement IDataErrorInfo then it isn’t do any validation error automatically for you. I always transform DataTable to ObservableCollection of my class that implement IDataErrorInfo.

    public class MyClass : IDataErrorInfo
    {
        //..
    }
    
    // Use ObservableCollection instead of DataTable
    ObservableCollection<MyClass> MyDataGridItemsSource { get; set; }
    

    I guess that the reason your textbox binding works is DF in your DF.FieldValue is implement IDataErrorInfo.

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

Sidebar

Related Questions

Why i cant set selecteditem property programatically? Im calling it from another XAML Window,
My question: How do I bind the SelectedItem from a primary datagrid to the
I want to fill an selectOneMenu with fields from my DataBase and then use
I am filling items to my ComboBox from a XML file using a DataTable.
is there ways to have a selecteditem and detect when it changes. what is
I have a ComboBox that has the SelectedItem bound to the ViewModel. <ComboBox SelectedItem={Binding
How do I bind a view model property to the ListBox.SelectedItem property? I have
In this code I am debugging, I have this code snipit: ddlExpYear.SelectedItem.Value.Substring(2).PadLeft(2, '0'); What
Here's some code: DirectorySearcher searcher = new DirectorySearcher(); searcher.Filter = (&(objectClass=user)(sAMAccountName= + lstUsers.SelectedItem.Text +
When changing the selected item in a ListBox, I'm getting a weird error where

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.