All docs
V18.2
20.2
The page you are viewing does not exist in version 20.2. This link will take you to the root page.
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
18.1
17.2

Overview - ColorEdit

ColorEdit represents a color editor control that has a dropdown window with a color palette.

Implementation Details

ColorEdit is realized by the ColorEditExtension class. Its instance can be accessed via the ExtensionsFactory.ColorEdit helper method, which is used to add a ColorEdit extension to a view. This method's parameter provides access to the ColorEdit's settings implemented by the ColorEditSettings class, allowing you to fully customize the extension.

ColorEdit's client counterpart is represented by the ASPxClientColorEdit object.

Declaration

ColorEdit can be added to a view in the following manner.

View code (ASPX):

<% 
    Html.DevExpress().ColorEdit(
        settings => {
            settings.Name = "colorEdit1";
            settings.Color = System.Drawing.Color.FromName("red");
        }
    )
    .Render();
%> 

View code (Razor):

@Html.DevExpress().ColorEdit(
    settings => {
        settings.Name = "colorEdit1";
        settings.Color = System.Drawing.Color.FromName("red");
    }).GetHtml()
NOTE

The Partial View should contain only the extension's code.

The code result is demonstrated in the image below.

coloredit-declaration.png

See Also