Filter on column in CGridView

Hi,

Could anyone tell me how to put a filter on an attribute coming from a related in a CGridView? Below is the admin.php view file. My product table is related to shop table by the foreign key shopId. The page rendered is ok except that I cannot filter on the column shop.name. Thanks beforehand.

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

'id'=&gt;'product-grid',





'dataProvider'=&gt;&#036;model-&gt;search(),





'filter'=&gt;&#036;model,





'columns'=&gt;array(





	'id',


	'shopId',


	'shop.name',


	array(





		'class'=&gt;'CButtonColumn',





	),





),

)); ?>

See this.

http://www.yiiframework.com/wiki/281/searching-and-sorting-by-related-model-in-cgridview

Softark, many thanks to you. That was a great link you gave. I have implemented it and it worked. :D