RibbonColorPicker

Represents a ColorPicker control in the SharePoint Server Ribbon.
SharePoint 2010 Ribbon Standard Color Picker

Inheritance Hierarchy


Assembly: QASPRibbon.dll
Namespace: QASPRibbon.Controls

Properties

Property Type Description
Id String A string that identifies the color picker, such as "RibbonControl". (Inherited from RibbonElement)
Title String A string value representing the color picker's label. (Inherited from RibbonElement)
Colors IEnumerable<RibbonColor> Gets or sets a collection of colors.
Visible Boolean A value that indicates whether a color picker control is rendered on the ribbon. (Inherited from RibbonVisualControl)
Enabled Boolean A value that indicates whether a color picker control is enabled. (Inherited from RibbonVisualControl)
ToolTip RibbonToolTip The tooltip of the color picker. (Inherited from RibbonVisualControl)
OnClientActivate String Client-side script that executes when a color picker is activated. (Inherited from RibbonButton)
OnClientClick String Client-side script that executes when a color picker's Click event is raised. (Inherited from RibbonButton)
OnClientStateCheck String Client-side script that executes before checking color picker is enabled or not. (Inherited from RibbonButton)
OnClientColorPreview String Client-side script that executes when mouse pointer on color hover.
OnClientColorRevert String Client-side script that executes when menu closed without color selection.

Events

Event EventHander Description
OnAction RibbonButtonActionEventHandler Server-side event that cccurs when the Button control is clicked

Constructors

public RibbonColorPicker()

public RibbonColorPicker(string id)

Example

The following example defines a color picker control with tooltip using standart color panel.
//ToolTip
var simpleColorPickerToolTip = new RibbonToolTip("ToolTip Title", "ToolTip Description");
//ColorPicker
var simpleColorPicker = new RibbonColorPicker("ColorPicker")
                    {
                        Colors = RibbonColorPicker.StandardColors,
                        ToolTip = simpleButtonToolTip,
                        OnClientClick = "alert('selected color: ' + properties.Color + ", selected style: " + properties.Style)"
                    };
simpleColorPicker.OnAction += new RibbonColorPickerActionEventHandler(simpleColorPicker_OnAction);


Method to handle color picker click event:
void simpleColorPicker_OnAction(object sender, RibbonColorPickerActionEventArgs e)
{
    var currentColorPicker = e.Instance;
    var selectedStyle = currentColorPicker.Style;
    var selectedColor = currentColorPicker.Color;
}

See also

Last edited Dec 24, 2012 at 10:00 AM by VitalyZhukov, version 6

Comments

No comments yet.