I have a grid in an edit template for another grid. When a row is deleted from the grid in the edit template, I need to pass the data key for the row that is deleted (to remove the row), which is no problem but I also need to pass the ID of the parent item (data key in parent grid). I have tried a few things to no avail:
Hooking up to onDelete event and trying to add in javascript:
function onImageDelete(e) { e.data = { inventoryItemId: key };}This doesn't work becuase e.data is null.
Then I tried adding it on teh .DataBinding declaration:
.DataBinding( dataBinding => dataBinding.Ajax() .Select( "BindImages", "CatalogAdministration" ) .Insert( "ImageCreate", "CatalogAdministration" ) .Delete( "ImageDelete", "CatalogAdministration", new { inventoryItemId = Model.InventoryItemId } ))But the value of the Model.InventoryItemId is always 0 for some reason - breakpoints are only hit when the parent grid is loaded, not when the edit button is clicked so at the time the code reaches the breakpoint there is no model loaded up into the grid.
Any help?