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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:49:58+00:00 2026-05-28T14:49:58+00:00

I have a WPF app that uses an Entity Framework Model. One of the

  • 0

I have a WPF app that uses an Entity Framework Model. One of the Entities is an Employee Type. This entity has a LastName and FirstName property among others. But in my xaml, I want to display a full name in my DataGrid. So I created this Partial Class to return the full name and I display this property in the DataGrid. This works great. The FullName is displayed in the DataGrid as expected.

public partial class Employee
{
    public string FullName
    {
        get { return LastName.Trim() + ", " + FirstName.Trim(); }
    }
}

The problem I have is that my edit form has textboxes bound to the LastName and FirstName properties. When I update values such as CompanyName, LastName, FirstName, HireDate, etc… all the columns in the DataGrid that were changed get updated correctly, but the FullName property does NOT get updated.

Why doesn’t my FullName partial class get updated while the rest of the DataGrid properties do get updated? How do I correct this?

Here is my editform xaml.

<TextBox Grid.Column="1" Name="txtCompany" Text="{Binding SelectedEmployee.Company, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
<TextBox Grid.Column="1" Name="txtFirstName" Text="{Binding SelectedEmployee.FirstName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
<TextBox Grid.Column="1" Name="txtLastName" Text="{Binding SelectedEmployee.LastName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
<TextBlock Grid.Column="1" Name="txtFullName" Grid.Row="2"  Margin="2" Text="{Binding SelectedEmployee.FullName" />    -- Also show as column in DataGrid
  • 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-28T14:49:59+00:00Added an answer on May 28, 2026 at 2:49 pm

    The change notification in WPF is done with the INotifyPropertyChanged interface.

    It works out of the box with Entity Framework because the generated entities (by the default edmx template) implement this interface and the generated property setters fire the PropertyChanged event.

    Your new property is not raising this event, but because it’s calculated from LastName and FirstName when those two change you need to raise the PropertyChanged event.

    Luckily EF will generate a partial method into each property setter with the name OnSomePropertyChanged from where you can raise the event:

    public partial class Employee
    {
        public string FullName
        {
            get { return LastName.Trim() + ", " + FirstName.Trim(); }
        }
    
        partial void OnLastNameChanged()
        {
             base.OnPropertyChanged("FullName");
        }
    
        partial void OnFirstNameChanged()
        {
             base.OnPropertyChanged("FullName");
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is an interesting conundrum. We have a WPF app that has a Vista-like
I am developing a WPF desktop app that uses Entity Framework 4 and SQL
I have a WPF app that uses a business object called Visit, it has
Context: I have a WPF App that uses certain unmanaged DLLs in the D:\WordAutomation\MyApp_Source\Executables\MyApp
I have a folder in my WPF app Images that has several .png files
I have a Windows Forms app, that has a single ElementHost containing a WPF
We have a WCF service that uses Entity Framework to query a SQL database.
I'm a complete beginner in WPF and have an app that uses StoryBoard to
I Have a Silverlight WPF app that shows tabs of data in this case
I have a WPF app that uses DispatcherTimer to update a clock tick. However,

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.