This example demonstrates how to create and register custom editors to be used for editing the content of report controls in Print Preview. In particular, it shows how to create a combo box editor, a date editor with a custom format and a standard text editor with a phone number mask.
The following image illustrates a custom combo box editor.
To implement a custom editor, create a new instance of an appropriate RepositoryItem descendant and specify its settings as required. Then, register this editor using the EditingFieldExtensionsWin.RegisterEditormethod. Enable editing of a control's content by setting the EditOptions.Enabledproperty to true and assign the created editor to the EditorNameproperty.
To register the standard text editor with a custom mask, use the EditingFieldExtensionsWin.RegisterMaskEditormethod.
Files to look at:• Form1.cs (VB: Form1.vb)