Hi Aaba,
After reading through this question again, I think I understand what you're trying to do. Instead of embedding the advanced search grid in the Form, I'd recommend adding a button that launches a search dialog. When the user makes their selection and returns from this dialog, you can then add the results as relationships.There's some sample code for how to launch a search dialog from a method in this blog post.
Search dialogs are both easier to use and are more widely used, so I'd recommend taking this approach since you can find a lot of existing sample code.
Chris