Activating a Custom Editor

There are two events that pertain to activating a custom editor.

 

ValueEditorActivating

This provides the ability to replace inbuilt editors with your own, so you could replace the inbuilt textbox without having to set the editor in the schema.

 

This provides the condition, a boolean value signifying if it is a list or single select mode, and the editor type that will be created if not replaced.

 

Using those 3 properties, you can ascertain what editor you need to replace and with what editor you want to replace it with, to replace the editor just set the e.Editor with the type of the object you wish to create.

eg.

VB.Net

 e.Editor = GetType(ClassName)

 

C#

e.Editor = typeOf(ClassName)

 

 

QueryNeedsCustomEditor

This event occurs when a field has a custom editor assigned in the schema. You will be provided with the condition, a string value that was entered by the in the schema editor, and if its list mode or single entry mode.

 

Using that information you can use the same code as above to assign the editor of your choice to assign the editor.