Cgridview with complex filter

I have 3 tables:

Companies => ID, name

Categories => ID, name

CompaniesCategories => ID, companyID, categoryID

Can I do a CGridview of companies with a column of categories and a dropdown filter of categories??? I know what to do when I have a one to many relation, but I’m confused qhen relation is many to many.

Thank you!!!!

Check this similar thread for some ideas - http://www.yiiframework.com/forum/index.php?/topic/14390-

Great solution mdomba!!!

Thank you very much! I’m driving crazy whit it, but I’m not able to find out this post :P