Plus and Minus operator errors in Row_Rendering server event

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
aspsteve
User
Posts: 52

Plus and Minus operator errors in Row_Rendering server event

Post by aspsteve »

I need help in including the plus and minus operators in row rendering.

Please see my below which is throwing an error

// Row Rendered event
public void Row_Rendered() {
    //VarDump(<FieldName>); // View field properties
ShortPayment.EditCustomAttributes = "readonly=\"readonly\"";
InvoiceTotal.EditCustomAttributes = "readonly=\"readonly\"";
InvoiceTotal.EditValue = "ExtendedAmount + TaxAmount";
ShortPayment.EditValue = "InvoiceTotal - PaymentAmount";
}

InvoiceTotal, ShortPayment, ExtendedAmount, TaxAmount are all existing fields in the table


MichaelG
User
Posts: 1095

Post by MichaelG »

You should convert the field value to the correct value type first before adding/subtracting. For example:

InvoiceTotal.EditValue = ConvertToDouble(ExtendedAmount.CurrentValue) + ConvertToDouble(TaxAmount.CurrentValue);
ShortPayment.EditValue = ConvertToDouble(InvoiceTotal.CurrentValue) - ConvertToDouble(PaymentAmount.CurrentValue);

Post Reply