This is a migrated thread and some comments may be shown as answers.

how to reference other forms in different projects

2 Answers 65 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Roger
Top achievements
Rank 1
Roger asked on 03 Jan 2018, 01:52 AM

Hi

I have several projects in the same solution (i.e clients, files, etc) and there are forms in all the projects with a main form as mdi parent in the "Main" project.

Now I'm having problems opening forms in other projects through the frmMain.formOpen procedure as I can't reference frmMain when frmMain is referencing frmClient (for example...otherwise I get cyclic referencing).

I want to be able to click a link on frmClient (in Client Project) which is a mdi child of frmMain (in Main project)  and open an mdi child (in frmMain) of frmComments which is in the Client project as well.

The Main project references the Client project so I can get a handle on the form in Client but now I can't get a handle on  the frmMain to run openform procedure on it to open the frmComment

 

Any suggestions how I could approach this (interface, event??)

 

Tried

Activator.CreateInstance(GetNamespace(frmName), frmName) as RadForm but the error is Could not load type 'formName' from assembly

2 Answers, 1 is accepted

Sort by
0
Roger
Top achievements
Rank 1
answered on 03 Jan 2018, 02:56 AM

OK..got it.

Have an public event from each form and raise it with the form required to be opened. 

On the main form add a handler to the event from that form (because the main form can reference all forms in all projects) and point it to a local procedure that adds the form (passed in the event argument) as an mdi child.

Works fine.

0
Dimitar
Telerik team
answered on 03 Jan 2018, 07:30 AM
Hello Roger,

This approach is ok and there is no reason not to use it.

In general, I would recommend you to use one project for the entire UI and put all forms in it. 

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Roger
Top achievements
Rank 1
Answers by
Roger
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or