This question is locked. New answers and comments are not allowed.
I have a grid which is bound to a collection of Invoice objects (see demo Invoice class below). ShowInsertRow = True.
If I modify an existing row NetAmount cell (say to 100) and tab off the TaxAmount & GrossAmount cells are updated. i.e. those cells are responding to the Invoice PropertyChanged events.
If I perform the same action on the 'click here to add new item' row the TaxAmount & GrossAmount cells do not respond to the Invoice PropertyChanged events. The cells remain with a value of '0' until you tab into the cell when the value changes to be correct.
I have a demo project to demonstrate the issue.
using System;using System.Net;using System.Windows;using System.Windows.Controls;using System.Windows.Documents;using System.Windows.Ink;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Animation;using System.Windows.Shapes;namespace RadControlsSilverlightApp1{ using System.ComponentModel; public class Invoice : System.ComponentModel.INotifyPropertyChanged { private decimal netAmount = 0m; public decimal NetAmount { get { return this.netAmount; } set { if (value != this.netAmount) { this.netAmount = Math.Round(value, 2); OnPropertyChanged("NetAmount"); } } } private decimal taxAmount = 0m; public decimal TaxAmount { get { return this.taxAmount; } set { if (value != this.taxAmount) { this.taxAmount = Math.Round(value, 2); OnPropertyChanged("TaxAmount"); } } } private decimal grossAmount = 0m; public decimal GrossAmount { get { return this.grossAmount; } set { if (value != this.grossAmount) { this.grossAmount = Math.Round(value, 2); OnPropertyChanged("GrossAmount"); } } } public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; private void OnPropertyChanged(string propertyName) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } if (propertyName == "NetAmount") { //this.taxAmount = Math.Round(this.netAmount * 0.20m); //this.grossAmount = Math.Round(this.netAmount + this.taxAmount); //// refresh UI //OnPropertyChanged(string.Empty); this.TaxAmount = this.NetAmount * 0.20m; this.GrossAmount = this.NetAmount + this.TaxAmount; } } }}