I wish to recalculate things everytime a DataGrid gets more rows or some are removed. I tried to use the Loaded
event, but that was fired only once.
I found
I was looking for solution to this and I have found the perfect event to handle this, the event is called UnloadingRow
...
In your C# code u get this
private void ProductsDataGrid_UnloadingRow(object sender, DataGridRowEventArgs e)
{
MyObject obj = (MyObject)e.Row.Item; // get the deleted item to handle it
// Rest of your code ...
// For example : deleting the object from DB using entityframework
}