Back to Devexpress

ASPxColorEdit.Color Property

aspnet-devexpress-dot-web-dot-aspxcoloredit-09cf47b1.md

latest3.8 KB
Original Source

ASPxColorEdit.Color Property

Gets or sets the editor’s color.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue(typeof(Color), "")]
public Color Color { get; set; }
vb
<DefaultValue(GetType(Color), "")>
Public Property Color As Color

Property Value

TypeDefaultDescription
ColorString.Empty

A Color object specifying the current editor color.

|

Remarks

Use the Color property to specify the color of the editor.

csharp
ASPxColorEdit1.Color = System.Drawing.Color.Red;

Note that setting the Color property does not invoke the ASPxClientEdit.ValueChanged and ASPxClientColorEdit.ColorChanged events.

To set the editor color in text format, use the ASPxColorEdit.Value property.

To specify the editor color on the client side, use the ASPxClientColorEdit.GetColor and ASPxClientColorEdit.SetColor methods.

Example

This part of the ASPxColorEdit online demo illustrates how the ASPxColorEdit can be used to customize the colors for the ASPxRoundPanel.

aspx
...
<dxe:ASPxColorEdit runat="server" ID="ColorEditHeaderBackColor" Color="#dedede">
    <ClientSideEvents ColorChanged="ColorChangedHandler" />
</dxe:ASPxColorEdit>
...
<dxcp:ASPxCallbackPanel runat="server" ID="CallbackPanel" 
ClientInstanceName="CallbackPanel" Width="275px" Height="119px" 
HideContentOnCallback="False">
    <PanelCollection>
        <dxp:PanelContent runat="server">
            <dxrp:ASPxRoundPanel runat="server" ID="RoundPanel" 
            EnableTheming="False" ShowDefaultImages="False">
                <PanelCollection>
                    <dxp:PanelContent runat="server">
                        <div style="width: 250px; height: 60px;">
                        Content
                        </div>
                   </dxp:PanelContent>
               </PanelCollection>
               <HeaderStyle>
                  <BorderBottom BorderWidth="0px" />
               </HeaderStyle>
           </dxrp:ASPxRoundPanel>
        </dxp:PanelContent>
    </PanelCollection>
</dxcp:ASPxCallbackPanel>
...
csharp
public partial class ASPxColorEdit_Example : BasePage {
     protected void Page_Load(object sender, EventArgs e) {
         RoundPanel.HeaderStyle.BackColor = ColorEditHeaderBackColor.Color;
         ...
     }
 }
javascript
function ColorChangedHandler(s, e) {
    CallbackPanel.PerformCallback();
}

See Also

GetColor

SetColor(value)

Value

Color Editor

ASPxColorEdit Class

ASPxColorEdit Members

DevExpress.Web Namespace