This example illustrates how to customize the Insert Merge Field menu to group merge field names with identical prefixes (Employees and Customers in this example) into submenus.
The DataBindingController
class generates menu items/subitems from the mail merge data source on the fly. These items are added to a popup menu.
When a custom menu item is clicked, the CustomInsertMergeFieldMenuItem.OnClick
method is executed to insert the current merge field.
When you click the Insert Merge Field Ribbon item, the built-in Insert Merge Field form is shown.
Note that the custom Insert Merge Field Ribbon item uses resources (images) from the project's Images folder to initialize the BarButtomItem.LargeGlyph
and BarButtonItem.Glyph
properties. Customize the LargeGlyph
and Glyph
properties of the CustomInsertMergeFieldItem
class to use another source for images.
- CustomInsertMergeFieldItem.cs (VB: CustomInsertMergeFieldItem.vb)
- DataBindingController.cs (VB: DataBindingController.vb)
- Form1.cs (VB: Form1.vb)
- Program.cs (VB: Program.vb)
(you will be redirected to DevExpress.com to submit your response)