[Expand]General Information
[Collapse]WinForms Controls
 [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
    [Collapse]Editors Structure
      Editor Hierarchy
      Editor Class Structure
      Editor Containers
      Repositories and Repository Items
      Custom Editors
    [Expand]Editors 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 Class Structure

This topic discusses how Editors are organized internally. It describes the classes used and explains how editors can be used for in-place editing in container controls.

Expanded Editor Class Structure

The DevExpress Editors are BaseEdit descendants. These classes represent stand-alone controls that you can place onto a form. These are also the controls that are created by containers when an editor is activated (when editing a cell value, for instance). Note: the BaseEdit class only implements the basic internal class structure, and doesn't introduce any editor functionality, but merely declares the members supporting the common look and feel, appearance and tooltips support mechanisms and the members required by container controls to work with their in-place editors.

Each editor control has its associated repository item. Repository items are objects that store editor settings and event handlers. You can access such objects via the editors' BaseEdit.Properties property. Note: when you create an in-place editor, you actually create a repository item object. This is possible because settings provided by repository items are sufficient to create fully functional editors. As stated above, the look and feel, appearance and tooltip mechanisms are implemented in actual editor classes. So, you will have no access to these settings (or need for them) when creating an in-place editor. These settings are controlled by container controls holding the in-place editors and you will only need to customize these settings when using standalone editors.

Two other significant class types are Painter and ViewInfo classes. They are initialized when the repository item is created using the internal CreatePainter and CreateViewInfo methods. A ViewInfo class (e.g. DateEditViewInfo) contains a set of properties necessary for drawing the control. When a control must be drawn (or redrawn), the Painter class (e.g. PainterTextEdit) uses the information supplied by the ViewInfo class to do it.

The image below illustrates an editor's internal structure. Repository items are capable of creating all the other classes.

As a result of this class structure, you can use the controls stand-alone or as in-place editors for other controls (such as Grid Control). Let's consider an editor used to edit grid column values. In this instance, the new RepositoryItem descendant is created within the grid's EditorContainer.RepositoryItems collection. This class initializes the Painter and ViewInfo classes. These classes are used to draw all cells within the column. And, the ingenious aspect is that the Painter and ViewInfo classes are separate from the editor class, allowing you to draw all cells without actually creating the control. The editor class itself is created only when a cell is edited and is removed when editing is finished.

When creating custom editor controls, you need to follow this editor structure, so that container controls can manage your editor properly.

Expanded Text Editors

Text editors in the XtraEditors library are represented by the TextEdit class and its descendants. Internally, each DevExpress text editor owns a text box that implements the text input functionality. A text editor, which is a wrapper for a text box, adds additional elements to the text box (borders and buttons).

The text box is represented by the DevExpress.XtraEditors.TextBoxMaskBox class, which is the System.Windows.Forms.TextBox control's descendant. Typically, you do not need to work with DevExpress.XtraEditors.TextBoxMaskBox controls directly. In specific cases, however, this control can be retrieved by certain functions; for example, when a text editor is focused, the form's ActiveControl property will return the editor's text box (a DevExpress.XtraEditors.TextBoxMaskBox object) rather than the editor itself. To get the editor, read the text box's Parent property. To get a DevExpress.XtraEditors.TextBoxMaskBox object corresponding to a specific editor, use the TextEdit.MaskBox property.

Expanded See Also

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