RibbonBarItemCollection
Namespace: Wisej.Web.Ext.RibbonBar
Assembly: Wisej.Web.Ext.RibbonBar (4.1.0.0)
Represents a collection of RibbonBarItem in a RibbonBarGroup.
- C#
- VB.NET
public class RibbonBarItemCollection : RibbonBarCollectionBase<RibbonBarGroup, RibbonBarItem>
Public Class RibbonBarItemCollection
Inherits RibbonBarCollectionBase(Of RibbonBarGroup, RibbonBarItem)
Properties
Item(name)
RibbonBarItem: Returns the first RibbonBarItem with the specified name .
Value: The first RibbonBarItem with the specified name or null.
The comparison with the Name property is case insensitive.
Throws:
- ArgumentNullException name is null.
Example:
Retrieving a RibbonBarItem by name:
var bold = (RibbonBarItemButton)this.ribbonBarGroup1.Items["bold"];
bold.Pushed = true;
Methods
Add(item)
Adds the specified item to the collection.
| Parameter | Type | Description |
|---|---|---|
| item | RibbonBarItem | The RibbonBarItem to add to the collection. |
The Parent of the item is set to the RibbonBarGroup that owns this collection.
Example:
Adding a new RibbonBarItem:
this.ribbonBarGroup1.Items.Add(new RibbonBarItemCheckBox { Name = "ruler", Text = "Ruler" });
Insert(index, item)
Inserts the specified item in the collection at the specified index .
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The position to insert the specified RibbonBarItem at. |
| item | RibbonBarItem | The RibbonBarItem to insert in the collection. |
The Parent of the item is set to the RibbonBarGroup that owns this collection.
Example:
Inserting a RibbonBarItem at a specific position:
this.ribbonBarGroup1.Items.Insert(0, new RibbonBarItemButton { Name = "paste", Text = "Paste" });