Filter in CGridView columns

Hi! I have a problem using filter in CGridView columns

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










		'filter'=>CHtml::listData(Letter::model()->findAll(), 'id','name'),





		'filter'=>CHtml::listData(Lang::model()->findAll(), 'id','name'),





                'name' => 'status',

                'value' => '$data->status ? \'yes\' : \'no\'',

                'filter' => array('0' => 'no', '1' => 'yes'),







CHtml::listData(Lang::model()->findAll(), ‘id’,‘name’) generates the array I want, but there is no dropdown list of available languages, although in the column before everything is allright.

Can anybody explain why ?

Beforehand thanks!

Hi Evrimedont, welcome to the forum.

As MrSoundless states in an other post,

CGridView filters hasMany relationship

So you have to introduce a virtual attribute for letter.lang_id.

See the link that he has posted for details.