Fancy Box

I have a form with an option of view,edit and delete.I am using fancybox and CButton Class of Grid View.The problem is that the form is displayed in a pop-up.But when I want to edit ,only the form is displayed with no popup.So,how to use popup so that I can edit the form also in a popup?