Sort by foreign key relationship in cgridview

I have the following code:

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







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











)); ?>

The code successfully implements a Client Name column and shows the client’s name (as opposed to their ID). However, I do not get a select dropdown in the header row like I would expect. Can someone shed some light into what I’m doing wrong here?

check this