RibbonDropDown

Represents a DropDown control in the SharePoint Server Ribbon.
SharePoint 2010 Ribbon DropDown

Inheritance Hierarchy


Assembly: QASPRibbon.dll
Namespace: QASPRibbon.Controls

Properties

Property Type Description
Id String A string that identifies the dropdown, such as "RibbonControl". (Inherited from RibbonElement)
Title String A string value representing the dropdown's label. (Inherited from RibbonElement)
Visible Boolean A value that indicates whether a dropdown control is rendered on the ribbon. (Inherited from RibbonVisualControl)
Enabled Boolean A value that indicates whether a dropdown control is enabled. (Inherited from RibbonVisualControl)
ToolTip RibbonToolTip The tooltip of the dropdown. (Inherited from RibbonVisualControl)
AltArrow String An alternative text that is used for the drop-down arrow button.
Alt String An alternative text that is used for the dropdown.
CacheMenuVersions Boolean A value that indicates whether constructed versions of a dynamic menu is stored to use in next time. The default is False.
PopulateDynamically Boolean A value that indicates whether a menu will be created dynamically (True) or not (False). The default is False.
PopulateOnlyOnce Boolean A value that indicates whether a dynamic menu will be populated only the first time that it is accessed. The default is False.
Width Uint32 The width in pixels of the text box that is part of this dropdown. The default is 100.
Sections IEnumerable<RibbonMenuSection> Sections used in root level of this dropdown.
OnClientActivate String Client-side script that executes when a dropdown is activated.
OnClientStateCheck String Client-side script that executes before checking dropdown is enabled or not.
OnClientMuneOpen String Client-side script that executes when menu is populated.
OnClientMenuClose String Client-side script that executes when menu is closed.

Events

Event EventHander Description
OnAction RibbonDropDownEventHandler Server-side event that cccurs when the dropdown' child menu item is clicked

Constructors

public RibbonDropDown()

public RibbonDropDown(string id)

public RibbonDropDown(string id, string title)

Example

The following example defines a dropdown control with tooltip.
//ToolTip
var simpleDropDownToolTip = new RibbonToolTip("ToolTip Title", "ToolTip Description");
//DropDown
var simpleDropDown = new RibbonDropDown("DropDown", "DropDown")
                    {
                        ToolTip = simpleDropDownToolTip,
                        Sections = new []
                        {
                            new RibbonMenuSection("Section1", "Section #1")
                            {
                                DisplayMode = RibbonMenuDisplayMode.Menu16, //Text only
                                Controls = new RibbonControl[]
                                {
                                    new RibbonButton("MS", "Microsoft")
                                    {
                                        OnClientClick = "alert(value);" // You can get selected value by using *value* variable
                                    }
                                }
                            }
                        }
                    };
simpleDropDown.OnAction += new RibbonDropDownEventHandler(simpleDropDown_OnAction);


Method to handle dropwon click event:
void simpleDropDown_OnAction(object sender, RibbonDropDownEventArgs e)
{
    var currentDropDown = e.Instance;
    var selectedValue = currentDropDown.SelectedValue;
}

See also




Last edited Dec 24, 2012 at 11:03 AM by VitalyZhukov, version 5

Comments

No comments yet.