Hi,
I have a datagrid with the columns ItemPrice and ItemQuantity and Total, I would like to multiply the ItemPrice and ItemQuantity columns to get the total. I've tried searching around but in vain, I know its been done before and I've seen multiple software systems do this. Could someone help me.
Loading
Niradhip ChakrabortyPosted Apr 16, 2008, 12:48 PM
You can do it in following way:
DataColumn dtc=new DataColumn("Sum",typeof(int));
dtc.Expression="Quantity * Cost";
dataTable.Columns.Add(dtc);