Filtering a cdatagrid using CActiveDataProvider

Just wondering if its possible to apply the filter textboxes to a gridview that uses a CActiveDataProvider, and if it is does anyone have a small example of this. So far i had no luck.

Thanks

Have you checked the default CRUD generated by Gii ?

The admin page has a CGridView with a filter… the values entered in a filter… are processed in the model search() method… there a new CActiveDataProvider is made from them…


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

	'id'=>'config-grid',

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

	'filter'=>$model,

	'columns'=>array(

	),

));

Something like that?

ive tried this, but my gridview looks like this:




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

    'dataProvider'=>$dataProvider,

    'filter'=>$model,

    'columns'=>array(



but the filter textboxes dont show. Here is how my dataprovider is defined in the controller:




$dataProvider=new CActiveDataProvider('KopieOpdracht', array(

				'criteria'=>$criteria,

			)


$this->render('index',array(

		'dataProvider'=>$dataProvider,

		'titel'=>'Kopieopdrachten',

					));