RibbonCheckBox

Represents a CheckBox control in the SharePoint Server Ribbon.
SharePoint 2010 Ribbon Checkbox

Inheritance Hierarchy


Assembly: QASPRibbon.dll
Namespace: QASPRibbon.Controls

Properties

Property Type Description
Id String A string that identifies the checkbox, such as "RibbonControl". (Inherited from RibbonElement)
Title String A string value representing the checkbox's label. (Inherited from RibbonElement)
Checked Boolean Gets or sets a value indicating whether the CheckBox control is checked.
Visible Boolean A value that indicates whether a button control is rendered on the ribbon. (Inherited from RibbonControl)
Enabled Boolean A value that indicates whether a button control is enabled. (Inherited from RibbonVisualControl)
ToolTip RibbonToolTip The tooltip of the button. (Inherited from RibbonVisualControl)
OnClientActivate String Client-side script that executes when a checkbox is activated. (Inherited from RibbonButton)
OnClientClick String Client-side script that executes when a checkbox's Click event is raised. (Inherited from RibbonButton)
OnClientStateCheck String Client-side script that executes before checking checkbox is enabled or not. (Inherited from RibbonButton)

Events

Event EventHander Description
OnAction RibbonCheckBoxEventHandler Server-side event that cccurs when the CheckBox control is clicked

Constructors

public RibbonCheckbox()

public RibbonCheckbox(string id)

public RibbonCheckbox(string id, string title)

Example

The following example defines a checkbox control with tooltip.
//ToolTip
var simpleCheckBoxToolTip = new RibbonToolTip("ToolTip Title", "ToolTip Description");
//CheckBox
var simpleCheckBox = new RibbonCheckBox("CustomCheckBox", "Checked or not")
                    {
                        OnClientClick = "console.log('CustomCheckBox has been pressed');",
                        ToolTip = simpleCheckBoxToolTip,
                    };
simpleCheckBox.OnAction += new RibbonCheckBoxEventHandler(simpleCheckBox_OnAction);


Method to handle checkbox click event:
void simpleCheckBox_OnAction(object sender, RibbonCheckBoxEventArgs e)
{
    var currentCheckBox = e.Instance;
    // Hide control
    currentCheckBox.Visible = false;
}

See also

Last edited Dec 19, 2012 at 3:59 PM by VitalyZhukov, version 5

Comments

No comments yet.