Note
The description of this example is currently under construction and may not match the code in the example. We are currently working to provide you with up-to-date content.
This example demonstrates a simple drop-down editor for reference properties. The editor provides the Open, Add and Clear buttons.
-
The Editors.Win module implements a reusable
LookupPropertyEditorEx
class. This is an XAF Property Editor that can be used for reference properties instead of the standardLookupPropertyEditor
in WinForms XAF applications. -
The
LookUpEditEx
andRepositoryItemLookUpEditEx
classes implement a control for this Property Editor. This control is inherited from theLookUpEdit
class and extends it with additional features required for the Property Editor.
-
From this example, you need use only one assembly (the WinSolution from the example is just a demo application, and it has no relation to the solution):
Editors.Win.dll
.Since this is a regular XAF module, you should add this module to your application to be able to use its features. In case of standard modules, you add them from the Toolbox via the Application or Module designer. Since we deal with a custom module, you should add this into the Toolbox manually. For additional information, refer to the following article: To add a tool to the toolbox.
Alternatively, you can take the source code and include it in your solution.
-
The
LookupPropertyEditorEx
is set as default for all lookup properties in the application.If you want to change this, then invoke the Model Editor for the Windows Forms application project or module, and change the EditorType property of the DetailViewItems | PropertyEditors | LookupProperty node. Or change the PropertyEditorType property for a class member, List View column or Detail View item nodes individually.