I Need a help. I created a datagrid and the value column of that grid is automatically calculated When Entering the unit price and hours using INotifyPropertyChanged.(Please see the attached picture). But I don't know how to get the Total value of that value column (sum of all values) automatically to total amount text box dynamically (Without using any button to calculate).( and also, if I delete a row then the value of that row should be automatically deducted from the Total amount.
Property Code :
public double UnitPrice
{
get { return _UnitPrice; }
set { _UnitPrice = value; OnPropertyChanged("UnitPrice"); OnPropertyChanged("Value"); }
}
public double Hours
{
get { return _Hours; }
set { _Hours = value; OnPropertyChanged("Hours"); OnPropertyChanged("Value"); }
}
public double Value
{
get { return _Value = UnitPrice * Hours; }
set { _Value = value; OnPropertyChanged("Value"); }
}
Your help is highly appreciated.
Thank you!
