Preselected Rows On Cgridview Or Selgridview

Hi everybody,

Can I define the rows or IDs already selected on cgridview or selgridview?


a Grid that show all the employees with some already selected (the ones that are already belongs to a project record).

Many thanks


in a CGridView you can specify a field like this:





   'checked'=>function($data) {

       	if ($data->class_id == Yii::app()->user->getState('ClassDefault')) {

   		$default[] = '1';


	else {

		$default[] = '0';


       	return implode(', ', $default);