The DevExpress ASP.NET MVC ColorEdit extension allows end-users to set a color of web elements with ease. You can type the value directly into the editor's text box, select a color from the color palette in the editor's dropdown window, or use the optional color picker to select a custom color. End-users can specify colors by typing directly within the edit box by using longhand or shorthand hexadecimal notation (HEX) for RGB color values (#f0f, #D8D8D8, etc.), or by using standard HTML color names ("red", "green", etc.), which are then automatically converted to color codes.
The custom color picker can be invoked by clicking the Custom Color… button in the color palette dropdown. The button is not displayed by default. You can show it by setting the Properties.EnableCustomColors property to true.
The Palettes combo box allows you to set one of the predefined color palettes, which is created programmatically using the properties and methods exposed by the ColorEditItemCollection collection (see the Controller code).
In this demo, ColorEdit instances are used to specify background and foreground colors for the header and content elements of an RoundPanel extension. On the server side, the selected color is applied to the corresponding property of the RoundPanel extension.
Local Copy of this Demo
To inspect the source code for this demo on your machine, you must first install our components via the DevExpress Component Installer.
You can open a local copy of this online demo directly from this webpage (if using v20.2.8, 21.1.4 or higher).
The source code files for this demo are installed (by default) in the following directory:
Open CS Solution
\Users\Public\Documents\DevExpress Demos XX.X\Components\ASP.NET\CS\MVCxDataEditorsDemos