Search code examples
kendo-gridkendo-asp.net-mvc

How to bind a variable in a grid to another variable in another column in the same grid?


I have a Kendo Grid where i get fees objects that contains : Fees- Taxes - and Fees After Taxes. Fees after taxes were calculated in the callled from the object ( in the object's class). i am adding taxes to the fees caclulations, i want when i edit the taxes it automatically edit (fees after taxes) and also updates the total fees after taxes in the footer.

function onTaxesChange(e) {
    var TaxesObject = e.sender;
    if (TaxesObject != null) {
        var grid = $("#InvoiceProgressNotesGrid").data("kendoGrid");
        var container = $(TaxesObject.wrapper).parent().parent();
    }
}

Solution

  • var item = $("#InvoiceProgressNotesGrid").data("kendoGrid").dataItem($(this).closest("tr"));
    var progreeNoteId = item.Id;
    var Fees = item.Fees;
    var Taxes = item.Taxes;
    var FeesAfterTaxes = (Fees * Taxes / 100) + Fees;
    item["FeesAfterTaxes"] = FeesAfterTaxes;
    

    this will update all objects in the selected item in the grid