RibbonBarItem
Namespace: Wisej.Web.Ext.RibbonBar
Assembly: Wisej.Web.Ext.RibbonBar (4.1.0.0)
Represents a single item in a RibbonBarGroup.
- C#
- VB.NET
public abstract class RibbonBarItem : Component
Public MustInherit Class RibbonBarItem
Inherits Component
This is the abstract base class of all the ribbon items: RibbonBarItemButton, RibbonBarItemSplitButton, RibbonBarItemButtonGroup, RibbonBarItemCheckBox, RibbonBarItemRadioButton, RibbonBarItemTextBox, RibbonBarItemComboBox, RibbonBarItemControl and RibbonBarItemSeparator. Items are arranged vertically in columns inside the group, see ColumnBreak.
Properties
ColumnBreak
Boolean: Returns or sets a value indicating whether a new column starts after this RibbonBarItem.
Value: true if the next item in the RibbonBarGroup is placed in a new column; otherwise, false. The default is false.
The items in a RibbonBarGroup are stacked vertically in a column; a new column is started after an item that has ColumnBreak set to true. Large (vertical) buttons and controls and separators always occupy a column of their own.
Example:
Stacking three small buttons in a column followed by a second column:
var group = new RibbonBarGroup { Text = "Font" };
group.Items.Add(new RibbonBarItemButton { Text = "Bold", Orientation = Orientation.Horizontal });
group.Items.Add(new RibbonBarItemButton { Text = "Italic", Orientation = Orientation.Horizontal });
group.Items.Add(new RibbonBarItemButton { Text = "Underline", Orientation = Orientation.Horizontal, ColumnBreak = true });
group.Items.Add(new RibbonBarItemCheckBox { Text = "Superscript" });
group.Items.Add(new RibbonBarItemCheckBox { Text = "Subscript" });
Enabled
Boolean: Returns or sets whether the RibbonBarItem can respond to user interaction. (Default: True)
Value: true if the item can respond to user interaction; otherwise, false. The default is true.
Image
Image: Returns or sets the image that is displayed next to a RibbonBarItem.
Value: The Image displayed next to the RibbonBarItem. The default value is null.
ImageIndex
Int32: Returns or sets the index value of the image assigned to the RibbonBarItem. (Default: -1)
Value: The index value of the Image assigned to the RibbonBarItem. The default is -1.
The index refers to an image in the ImageList of the RibbonBar that contains this item.
Throws:
- ArgumentOutOfRangeException The specified index is less than -1.
ImageKey
String: Returns or sets the name of the image assigned to the RibbonBarItem. (Default: "")
Value: The name of the Image assigned to the RibbonBarItem.
The key refers to an image in the ImageList of the RibbonBar that contains this item.
ImageSource
String: Returns or sets the theme name or URL for the image to display next to a RibbonBarItem.
Value: The theme name or URL for the image to display next to the RibbonBarItem.
Example:
Using a theme icon or a URL as the image of an item:
this.buttonSave.ImageSource = "icon-save";
this.buttonExport.ImageSource = "Images/export.png";
Name
String: Returns or sets the name of the RibbonBarItem.
Value: The name of the RibbonBarItem.
The name can be used to retrieve the item from the Items collection (case insensitive) and to identify the item in the ItemClick event. At design time it's the name of the component in the designer.
Parent
RibbonBarGroup: Returns the RibbonBarGroup that owns this RibbonBarItem.
RibbonBar
RibbonBar: Returns the RibbonBar that contains this RibbonBarItem.
Returns null until the item is added to a RibbonBarGroup that belongs to a RibbonBarPage in a RibbonBar. The events of an item that is not connected to a RibbonBar are not fired.
Tag
Object: Returns or sets the object that contains data about the control. (Default: null)
Value: An object that contains user-defined data about the control. The default is null.
Text
String: Returns or sets the text of the RibbonBarItem. (Default: "")
Value: The text displayed in the RibbonBarItem.
ToolTipText
String: Returns or sets the tooltip text for the RibbonBarItem. (Default: "")
Value: The text displayed in a tooltip for the RibbonBarItem.
Visible
Boolean: Returns or sets whether the RibbonBarItem is visible or hidden. (Default: True)
Value: true if the item is visible; otherwise, false. The default is true.
A hidden item doesn't take any space in the RibbonBarGroup layout.
Methods
Dispose(disposing)
Disposes of the resources (other than memory) used by the RibbonBarGroup.
| Parameter | Type | Description |
|---|---|---|
| disposing | Boolean | true when this method is called by the application rather than a finalizer. |
OnWebRender(config)
Renders the client component.
| Parameter | Type | Description |
|---|---|---|
| config | Object | Dynamic configuration object. |
Update()
Updates the component on the client.
Changing the properties of the item already updates the client. At design time the entire RibbonBar is updated.
Example:
Forcing the item to be updated on the client:
this.buttonSave.Update();
ValidateActiveControl()
Validates the current control.
Returns: Boolean. true if the active control is validated.
Events
Click
EventHandler Fired when the RibbonBarItem is clicked.
Inherited By
| Name | Description |
|---|---|
| RibbonBarItemButton | Represents a button in a RibbonBarGroup. |
| RibbonBarItemButtonGroup | Represents a group of buttons in a RibbonBarGroup organized horizontally. |
| RibbonBarItemCheckBox | Represents a checkbox in a RibbonBarGroup. |
| RibbonBarItemComboBox | Represents a combobox in a RibbonBarGroup. |
| RibbonBarItemControl | Represents a user defined control in a RibbonBarGroup. |
| RibbonBarItemRadioButton | Represents a radio button in a RibbonBarGroup. |
| RibbonBarItemSeparator | Represents a vertical separator in a RibbonBarGroup. |
| RibbonBarItemSplitButton | Represents a split button in a RibbonBarGroup. |
| RibbonBarItemTextBox | Represents a textbox in a RibbonBarGroup. |
Implements
| Name | Description |
|---|---|
| IUserData | |
| IWisejComponent | |
| IWisejSerializable |