How to set CssFile for CGridView in config file

I need a way to set cssfile globally, when I try set the cssfile or any other property in config file, it shows an error that ‘Property “CWebApplication.widgetFactory” is read only.’ . For example, following code shows the error.

widgetFactory’=>array(

widgets’=>array(

CLinkPager’=>array(

maxButtonCount’=>5,

),

CGridView’=>array(

cssFile’ => ‘/css/style-gridview.css’,

),

),

),

I am using 1.1.5. can anyone please help.

Thanks,

is it set insite components ?




'components'=>array(

  'widgetFactory'=>array(

	//...

  )

);



It must be

You can enable "widget factory" to create the widget "instead" using CBaseController->createWidget();

You can’t define widget factory properties outside application configuration: http://www.yiiframework.com/doc/api/1.1/CWidgetFactory


widgetFactory property read-only (available since v1.1)

http://www.yiiframework.com/doc/api/1.1/CWebApplication#widgetFactory-detail

Thanks, its working now,