[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Collapse]Editors and Simple Controls
   [Collapse]Simple Editors
    [Expand]Included Components
    [Expand]Editors Structure
    [Collapse]Editors Features
      Text Editing Overview
     [Expand]Input Mask
     [Expand]Format and Parse Editor Values
     [Collapse]Editor Buttons
       Editor Button Shortcuts
       Spin Buttons
     [Expand]Dropdown Editors Overview
      Image Editing Menu
     [Expand]Data Binding Overview
     [Expand]Appearance Customization
     [Expand]Miscellaneous Features
    [Expand]Member Tables
   [Expand]Lookup Editors
   [Expand]Token Edit Control
   [Expand]Breadcrumb Edit Control
   [Expand]Range Control
   [Expand]Image Slider
    Camera Control
    Templated ListBox Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Editor Buttons

ButtonEdit editors and descendants can display a number of buttons within their edit boxes. The ButtonEdit class introduces properties and events for management editor buttons. This topic provides general information on creating, customizing and using editor buttons.

Once a button editor (or descendant) has been placed on a form, you can access its button collection via the RepositoryItemButtonEdit.Buttons property. Clicking the ellipsis button corresponding to the Buttons property invokes the EditorButton Collection Editor dialog. This dialog manages the editor's button collection (i.e. add, remove buttons). Each button is represented by an EditorButton object and its properties can be accessed using the property grid.

The next image shows various editor button settings.

The table below lists all button settings illustrated and describes them briefly.

Property Description
EditorButton.Caption Specifies the text displayed by the editor button.
EditorButton.Enabled Specifies whether the editor button responds to user actions.
EditorButton.Image Specifies the image to be displayed in the button.
EditorButton.ImageLocation Specifies the image's alignment relative to the button's caption.
EditorButton.IsLeft Specifies the button's alignment within the edit box.
EditorButton.Kind Specifies the button's kind (the type of image to display in the button).
EditorButton.Width Specifies the button's width. If it is set to -1, the button width is calculated automatically based on the caption and image size.

You can hide a button by setting its EditorButton.Visible property to false.

In addition, the button's appearance can be customized using the EditorButton.Appearance property.

The editor buttons' paint style is specified by the repository item's RepositoryItemButtonEdit.ButtonsStyle property. This property value can be overridden by the style controller assigned to the editor. Please refer to the Border and Button Styles and Style Controller topics for additional information.

To respond to clicking buttons, handle the RepositoryItemButtonEdit.ButtonClick and RepositoryItemButtonEdit.ButtonPressed events. These events are also raised when pressing a button's associated shortcut. Please refer to the Editor Button Shortcuts topic for additional information.

Expanded Example - Creating a Button Editor at Runtime

The code below shows how to create and customize a button editor via code.

The following image shows the button editor created and customized using the code above.

Expanded See Also

Is this topic helpful?​​​​​​​