Calculated field in a gridview
Posted on 2011-09-07
Using asp.net 4 with either C# or vb.net as the code behind I want to have a calculated field in a gridview, i have researched how to do this and it seems there are several options, in my gridview amongst other fields i have: Item_Price, Quantity and Total, i want the Total field to = the Item_Price * Quantity, the only bound field is the Item_Price the other two are Templates, i have tried using:
<asp:Label Text='<% Eval ("Item_Price") * Eval ("Quantity") %>'
This does not work though, ideally I would like a checkbox in the gridview to trigger the calculation.
Hope somebody can help