Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Event to call when value changes
Message
From
24/01/2013 06:58:30
 
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01563626
Message ID:
01563940
Views:
43
>You could wire up the changed event in the window constructor:
    foreach (var c in DataGridItemsSourceCollection)
>      {
>        c.PropertyChanged += CollectionItemChanged;
>      }
then, with the textbox wired to 'TotalAmt:
   void CollectionItemChanged(object sender, PropertyChangedEventArgs e)
>    {
>      if (e.PropertyName == "awd_amount")
>      {
>        TotalAmt = DataGridItemsSourceCollection.Sum(x => x.awd_amount);
>        OnPropertyChanged(new PropertyChangedEventArgs("TotalAmt"));
>      }
>    }
Quick and dirty - there may be more elegant ways :-{

Thanks Viv,

I have been using a plain unbound textbox to display the total. Do I need to somehow declare TotalAmt as a property of something and bind the textbox to that? If so, should this be a property of the form? or of my Business Object (BO)?

Basically I have AirWayBill is my main BO and AirWayBillDetail is a child of BO. Do I need to create a TotalAmt property on AirWayBill in order to get this to work?
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform