Skip to main content

RibbonBarItemComboBox

Namespace: Wisej.Web.Ext.RibbonBar

Assembly: Wisej.Web.Ext.RibbonBar (4.1.0.0)

Represents a combobox in a RibbonBarGroup.

public class RibbonBarItemComboBox : RibbonBarItem

The Text and the image are displayed as a label to the left of the combo box; the list of options is set in Items and the current value is in the Value property. The user can move between the combo boxes and text boxes in the same RibbonBarGroup using the Tab and Shift+Tab keys.

Constructors​

Instance member RibbonBarItemComboBox()​

Initializes a new instance of RibbonBarItemComboBox.

Properties​

Instance member Editable​

Boolean: Returns or sets whether the user can edit the combobox. When this property is false, the user can only select one of the drop down items. (Default: False)

Value: true if the user can type any text in the field; otherwise, false. The default is false.

Instance member FieldWidth​

Int32: Returns or sets the width of the ComboBox field inside the RibbonBarItemComboBox. (Default: 120)

Value: The width of the combo box field in pixels, not including the label. The default is 120.

Instance member Items​

String[]: Returns or sets the array of items displayed in this RibbonBarItemComboBox.

Value: An array containing the items in the RibbonBarItemComboBox.

The getter returns null until a value is assigned; assigning null sets an empty array. The drop down list on the client is rebuilt only when a new array is assigned: changing the elements of the array returned by the getter doesn't update the client.

Example:

Filling the drop down list with a list of font names:

this.comboBoxFont.Items = new[] { "Arial", "Calibri", "Segoe UI", "Times New Roman" };

// add an item: assign a new array.
this.comboBoxFont.Items = this.comboBoxFont.Items.Concat(new[] { "Verdana" }).ToArray();

Instance member Value​

String: Returns or sets the currently selected item or the value in the editable field of the RibbonBarItemComboBox. (Default: null)

Value: The selected or typed text. The default is null.

When Editable is true, the value can be any text typed by the user, not only one of the Items. Every change, including assigning the value in code, fires the ValueChanged event on the item and the ItemValueChanged event on the RibbonBar.

Example:

Selecting a value in code and reacting to the user's selection:

this.comboBoxZoom.Items = new[] { "50%", "75%", "100%", "150%", "200%" };
this.comboBoxZoom.Value = "100%";

private void comboBoxZoom_ValueChanged(object sender, EventArgs e)
{
SetZoom(int.Parse(this.comboBoxZoom.Value.TrimEnd('%')));
}

Methods​

Protected member OnValueChanged(e)​

Fires the ValueChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnWebEvent(e)​

Processes the event from the client.

ParameterTypeDescription
eWisejEventArgsEvent arguments.

Protected member OnWebRender(config)​

Renders the client component.

ParameterTypeDescription
configObjectDynamic configuration object.

Protected member OnWebUpdate(state)​

Updates the client component using the state information.

ParameterTypeDescription
stateObjectDynamic state object.

Events​

Instance member ValueChanged​

EventHandler Fired when the value of the Value property changes.

Implements​