When the user interface for a database field has to be displayed, the first step is to determine the proper user interface template. The template set has the responsibility to inspect the database schema and determines which user interface template to be used. The templates are identified by the ID of the TemplateHolder that contains them. 

There are two similar mechanisms for template selection: inline and precompiled.

Inline Template Selection

In order to use inline template selection the TemplatesUserControl.SelectTemplateID Method has to be overridden in the template set user control.

Because the code in the user control is not compiled at design time, template selection is not available at design time when using inline template  selection.

You can easily switch to precompiled template selection by copying the code from the SelectTemplateID method to a precompiled template selection class.

Precompiled Template Selection

To use precompiled template selection, a class that inherits from the Adillis.SmartDBForms.ITemplateSelector interface must be created first. The class must be located in an assembly that is accessible at design time. For example in the Bin folder of the web project.

The type name of the class to use for precompiled template selection is set in the TemplatesControlCenter.TemplateSelectorType Property.

After you have set value for the TemplateSelectorType property the inline template selection is not used anymore. If you want to use the inline template selection you have to remove the value of the TemplateSelectorType property.

 

See Also

TemplateHolder | TemplatesUserControl.SelectTemplateID Method | Adillis.SmartDBForms.ITemplateSelector | TemplatesControlCenter.TemplateSelectorType