You have to add a check to the value expression
array(
'name'=>'parent.name',
'value'=>'($data->parent_id)?data->parent->name:""'
)
EDIT
For best practice you should leave parent_id
blank instead of putting in a zero. If not every single time you want to access the parent using $model->parent
you would have to perform the above check. Also for the grid parent.name
could have been used instead of the above.
'name',
'parent.name',
array(
'class'=>'CButtonColumn',
),