Cgridview Properties

how change the max items per page in CGridView? (pagination)

also I want to change the default searching by column change the text by combobox. How I could do that?

I found related article about CGridView (http://www.yiiframework.com/doc/api/1.1/CGridView) but I couldn’t make it.

The IDataProvider interface, e.g. CActiveDataProvider is your friend

I guess you have figured by now how to change number items. (Edit: max items per page)

For this one, outside classic input field, you can set the [font="Courier New"]filter[/font] property in the relevant column to what you want. So for a combobox, you set it to a [font="Courier New"]CHtml::listData()[/font]

I never figured the number of records per page, I generated the code by gii, the default max row per page is set to 10, but I can’t find where is set.

I want to change the settings of CGridView on admin page

You have to pass the properties/config for pagination to CActiveDataProvider. Look at the CActiveDataProvider api docu example.

you can do something as following


	$dataProvider=new CActiveDataProvider("Model", array(

		    'pagination'=>array(

		        'pageSize'=>10,

		    ),

		));

Thanks all of you

it works! :)