MindFusion.UI for WebForms Programmer's Guide

ColorPicker

The ColorPicker control represents a text-box control with the ability to parse and select colors from a popup preset.

Server side

  • Getting and setting the control's color
    Use the ColorPicker.Value property to get or set the control's current color.

  • Customizing the control
    The ColorPicker control supports three different types of palette color presets as specified in the ColorPreset enumeration.
    The position of the popup preset can be adjusted by using the PopupAlignRight and PopupAlignTop properties.

  • Events
    The following events are exposed by the ColorPicker class.

    Event

    Event arguments

    Description

    ValueChanged

    ValueChangedEventArgs<Color>

    Raised when the control's value has changed

Client side

  • Getting a reference to the control
    You can access the control on the client side by its ClientID.
     
    JavaScript  Copy Code
    var colorPicker = $find("ColorPicker1");
    var colorPicker = $find("<%= ColorPicker1.ClientID %>");


  • Getting and setting the control's color
    Use the get_value and set_value methods to get or set the control's color.

    JavaScript  Copy Code

    colorPicker.set_value("#FF0000");
    alert(colorPicker.get_value());