RibbonComboBox

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

Inheritance Hierarchy


Assembly: QASPRibbon.dll
Namespace: QASPRibbon.Controls

Properties

Property Type Description
Id String A string that identifies the combo box, such as "RibbonControl". (Inherited from RibbonElement)
Title String A string value representing the combo box's label. (Inherited from RibbonElement)
Visible Boolean A value that indicates whether a combo box control is rendered on the ribbon. (Inherited from RibbonVisualControl)
Enabled Boolean A value that indicates whether a combo box control is enabled. (Inherited from RibbonVisualControl)
ToolTip RibbonToolTip The tooltip of the combo box. (Inherited from RibbonVisualControl)
AllowFreeForm Boolean A value that indicates whether input is restricted so that only items on the menu are submitted. The default is False.
AltArrow String An alternative text that is used for the drop-down arrow button.
Alt String An alternative text that is used for the combo box.
AutoComplete Boolean A value that indicates whether autocomplete suggestions is turned on (True) or off (False). The default is False (off).
AutoCompleteDelay UInt32 A value that represents a delay in milliseconds before AutoComplete fills the text box with a best-guess match. The default is 100.
CacheMenuVersions Boolean A value that indicates whether constructed versions of a dynamic menu is stored to use in next time. The default is False.
ImeEnabled Boolean A value that indicates whether Input Method Editor (IME) is activated. 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 combo box. The default is 100.
Sections IEnumerable<RibbonMenuSection> Sections used in root level of this combo box.
OnClientActivate String Client-side script that executes when a combo box is activated.
OnClientStateCheck String Client-side script that executes before checking combo box 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 RibbonComboBoxEventHandler Server-side event that cccurs when the combo box' child menu item is clicked

Constructors

public RibbonComboBox()

public RibbonComboBox(string id)

public RibbonComboBox(string id, string title)

Example

The following example defines a combo box control with tooltip.
//ToolTip
var simpleComboBoxToolTip = new RibbonToolTip("ToolTip Title", "ToolTip Description");
//ComboBox
var simpleComboBox = new RibbonComboBox("ComboBox", "Combo Box")
                    {
                        ToolTip = simpleButtonToolTip,
                        AutoComplete = true, //Turn on autocomplete
                        AutoCompleteDelay = 200, //Set autocomplete delay to 200 milliseconds
                        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
                                    }
                                }
                            }
                        }
                    };
simpleComboBox.OnAction += new RibbonComboBoxEventHandler(simpleComboBox_OnAction);


Method to handle combo box click event:
void simpleComboBox_OnAction(object sender, RibbonComboBoxEventArgs e)
{
    var currentComboBox = e.Instance;
    var selectedValue = currentComboBox.SelectedValue;
}

See also

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

Comments

No comments yet.