This is a migrated thread and some comments may be shown as answers.

Updating Total Column on Master row when Detail rows are updated

1 Answer 69 Views
GridView
This is a migrated thread and some comments may be shown as answers.
lori guymon
Top achievements
Rank 1
lori guymon asked on 12 Jun 2010, 08:46 PM
Hello,
I am using RIA services and have two entities (Order and OrderDetail) that have a one-to-many relationship.  I am binding a RadGridView to a collection of Orders and have a detail grid displayed when a gridrow for a given Order is expanded.  

I have added a "Total Order" column in the Master grid using the example in the silverlight demo app (http://demos.telerik.com/silverlight/#GridView/FirstLook) that displays the sum of the orderdetail (qty * price) rows for each order.  I have added the necessary functionality to add, edit and remove OrderDetail entities in the detail grid and this works great.  

My question\problem is, how do I update the "Total Order" column in the master row when the detail rows have been modified\added\deleted?   I noticed in the gridview demo that the Order Value column does not update either when the user updates the quantity or price for Order Detail Lines rows.  

This seems like such a simple task to accomplish but I have tried several ways of approaching this and no success yet.  Can anyone help me out on this one?

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 14 Jun 2010, 07:34 AM
Hello,

 You can use CollectionChanged (and/or PropertyChanged) of your child data to refresh the parent collection. RadGridView will reflect this immediately and will update itself.  Other possible approach is to handle event of the child grid like CellEditEnded, etc. and call Rebind() for the parent grid.

Kind regards,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
lori guymon
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or