ColorEdit Class

The editor that allows you to select a color from a dropdown window.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v20.1.dll

Declaration

[DefaultBindingPropertyEx("Color")]
public class ColorEdit :
    PopupBaseEdit
<DefaultBindingPropertyEx("Color")>
Public Class ColorEdit
    Inherits PopupBaseEdit

Related API Members

The following members accept/return ColorEdit objects:

Remarks

The ColorEdit class encapsulates a color editor which enables the end-user to select a color from the dropdown window. The dropdown contains three tabbed pages displaying predefined custom, web and system colors.

The following image shows a color editor with a color selected from the Web panel.

ColorEdit

By default, the editor contains 16 predefined colors in the Custom panel.

If the RepositoryItemColorEdit.ShowColorDialog property is set to true, the end-user is able to define and edit these colors by right-clicking the corresponding color box. In this case, the standard color dialog is activated and this enables you to select a color and add it to the Custom panel. Non- custom colors cannot be changed by right-clicking the color box.

ColorEdit_CustomColors

To specify custom colors at design time or via code, see the RepositoryItemColorEdit.CustomColors property.

To select a particular color, left-click it with the mouse.

The color currently selected can be specified via the ColorEdit.EditValue or ColorEdit.Color properties. These properties can be used interchangeably, and they only differ by the type of the return value. ColorEdit.Color returns the selected color as a Color structure, while edit value returns the selected value either as an integer or Color value, depending on the RepositoryItemColorEdit.StoreColorAsInteger property value.

See the editor's ColorEdit.Properties property to customize the editor's appearance and behavior.

To create a color editor as an inplace control for XtraGrid, for instance, you need to create a RepositoryItemColorEdit object. The repository item should then be assigned to the appropriate column. The grid control creates an inplace editor as required, based on the settings of the repository item assigned to the column.

See Also