When a row is updated in the child container it subtracts that amount from the total amount in the parent row. I accomplished this by getting the numbers subtracting them and then setting the parent cell. It shows up perfectly but doesn't commit back to the database. If I postback that information is lost. How do I update the database with the new value?
var amount = eventArgs._cells[4]._old;
var newamount = eventArgs._cells[4]._val;
var parentindex = sender._parentRow._index
var grid = ig_controls["WebHierarchicalDataGrid1"].get_gridView();
var parentvalue = grid.get_rows().get_row(parentindex).get_cell(5).get_value()
var total = parentvalue-(newamount - amount);
grid.get_rows().get_row(parentindex).get_cell(5).set_value(total);
Hello DMandy,
Thank you for contacting us.
I have tried to reproduce this behavior, although I couldn't, If you use BatchUpdating, you will need to call commit() in order to commit the changes, if not, they will be committed when post back is made (through a button for example). Could you please send me isolated sample that is reproducing the issue in order to investigate it further for you.
Code snippet:
function BandExitedEditMode(sender, eventArgs) {
var grid = $find(sender.get_id());
var editingCore = grid.get_behaviors().get_editingCore();
editingCore.commit();
}
References:
http://es.infragistics.com/samples/aspnet/data-grid/batch-updating
Thank You! All it needed was the commit and now its working
Hello,
I am glad that I've managed to help you.