This example demonstrates how to create an unbound column (Sum) that changes its values based on other column values dynamically in batch edit mode.
Set the unbound column's ShowEditorInBatchEditMode property to false
to make the column read-only in batch edit mode.
<dx:GridViewDataTextColumn FieldName="Sum" UnboundType="Decimal" ReadOnly="true">
<Settings ShowEditorInBatchEditMode="false" />
</dx:GridViewDataTextColumn>
Handle the client BatchEditEndEditing event to recalculate column values based on the changes and call the SetCellValue method to set the new column value.
function OnBatchEditEndEditing(s, e) {
window.setTimeout(function () {
var price = s.batchEditApi.GetCellValue(e.visibleIndex, "Price");
var quantity = s.batchEditApi.GetCellValue(e.visibleIndex, "Quantity");
s.batchEditApi.SetCellValue(e.visibleIndex, "Sum", price * quantity, null, true);
}, 0);
}
- Default.aspx (VB: Default.aspx)
- GridView for MVC - How to calculate values on the fly in batch edit mode
- GridView for Web Forms - How to update total summaries on the client side in batch Edit mode
- GridView for Web Forms - How to calculate unbound column and total summary values on the fly in batch edit mode
- GridView for Web Forms - How to change a cell value based on another cell value in batch edit mode
(you will be redirected to DevExpress.com to submit your response)