Show Hide Column conditionally from Another table

Hi All,

Im recently started devoloping in Yii framework.

i really need your help to solve this issue.

Is there any way that i can visible=false column in cgridview according to another table selection.

Example :

Im getting data to grid from customer table.

Customer Name, Customer Add, Customer Mobile, Customer Email, Customer Company

then my fields table is(giving permission to which fields need to show in grid)

Customer Company, FieldName

i just need to show only customer Name,Customer Add in grid according to customer company.

need to change according to field table permission

hope you can understand what i need to do.

pls direct me to right place