changing column name in GridView with CSqlDataProvider

I’m using CSqlDataProvider(So I can do joins etc.) instead of CActiveDataProvider for CGridView, but it seems if you use CSqlDataProvider you can’t use ‘$data->’ when referencing values. So if you want to change it will error. (Error=‘Trying to get property of non-object’). Any Ideas?

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







		'name'=>'last name',




Welcome to the forum!

For CSqlDataProvider (and CArrayDataProvider) db rows are repesented by arrays instead of objects



I try it:



                        'filter'=>CHtml::listData(LoaiGiaoDich::model()->findAll(), 'maLoaiGD', 'tenLoaiGD'),



but it causes error: Trying to get property of non-object. (I don’t know how to use $data variable)

who can help me? Please.

Sorry for the late Thank you. Thanks!