Showing results for 
Search instead for 
Do you mean 

Layout Designer and Custom Field-bound Control

Tuned Listener
Posts: 8
Country: Australia

Layout Designer and Custom Field-bound Control

I am developing a field-bound control that should be available for placing on any Entity layout, in the Layout Designer. I am now up against a problem that I cannot find a mention of in any blog, news, or documentation anywhere.

The control is basically a 'MutableEntity' type. I can make it work on for instance a Contact layout by declaring the Designer as 'ContactFieldBoundControlDesigner' in the control's class Attributes. However it remains available in the Designer Toolbox no matter what type of layout is being edited. Placing it on a layout other than a Contact layout can be done, but it will not work, as the Designer always supplies a list of Contact fields only for connection to it, and of course if the other-than-Contact layout is then displayed at run-time, the Contact field it wants to connect with is not avialable to it.

Declaring the Designer as 'MutableEntityFieldBoundControlDesigner' fails because the list of fields offered for connection at design-time is empty.

I could make four tools - one for each Entity type, but they will all always be available in the Layout Designer Toolbox, no matter what type of layout is being edited. What I really want is one tool that the Layout Designer will supply with a choice of fields that depends upon the layout being edited, not the tool!

Any ideas as to how to achieve that would be most welcome.