How To Multiply Values On A Cgridview?

Hi…everyone…

Im trying to create a cgridview column which computes the total amount of two values Qty and UnitPrice…problem is…i dont know how???

glad to see the answers :))

$this->widget(‘zii.widgets.grid.CGridView’, array(

					'id'=>'so-detail-grid',


					'dataProvider'=>$mod->getAllRelDocNo($dn),


					'filter'=>$mod,


					'columns'=>array(


						'Qty',


						'UnitMeas',


						'ItemDesc',


						'CurSign',


					'UnitPrice',


					'War_Parts',


						'War_Labor',


						'War_Onsite',


						              array('name'=>'..','value'=>Qty*UnitPrice),


						


						array(


					  'class'=>'CButtonColumn',


					  'viewButtonUrl'=>'Yii::app()->createUrl(\'sodetail/view&id=\'. $data->DetailNo)',


					  'updateButtonUrl'=>'Yii::app()->createUrl(\'sodetail/update&id=\'. $data->DetailNo)',


					  'deleteButtonUrl'=>'Yii::app()->createUrl(\'sodetail/delete&id=\'. $data->DetailNo)',


					),


					),


				)); ?>

you cam fetch the total on getAllRelDocNo function otherwise you can call custome function on value


array(


'name'=>'firstname',


'header'=>'Name',


'value'=>'Users::model()->gettotal()',


),


public function gettotal(){

  //write a query

}



Thanks ^_^ it works :rolleyes: