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.
See Also