HOW to add an special attribute to the filter area in CGridView

Hi, I have this CGridView configuracion for my Model:

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

	'id' => 'cuota-grid',

	'dataProvider' => $model->search(),

	'filter' => $model,

	'columns' => array(







			'filter'=>GxHtml::listDataEx(Alumno::model()->findAllAttributes(null, true)),


















			'class' => 'CButtonColumn',




)); ?>

As you can see, I have a related field (LegajoYApellidoYNombre), this fiels is a calculated field in the Model Alumno:

	public function getLegajoYApellidoYNombre() {

		return $this->legajo_numero.' - '.$this->apellido.', '.$this->nombre;


In the CGridView I didn’t see any text field above the columns data …

I also alter search in Cuota model:

		//$criteria->compare('fk_alumno_id', $this->fk_alumno_id);

		$criteria->compare('fkAlumno', $this->fkAlumno, true);

And also added thse field to “safe” in rules of Alumno’s model:

array('LegajoYApellidoYNombre', 'safe'),

What I’am doing wrong ?

Best Regards

Hi, xNicox,

This is one of the best wiki articles, IMO. And I hope it will help you, too.