[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Forms.IListBox

IListBox Interface

Represents a list box control.

A list box displays a collection of ListBoxItem objects and lets users select one or more items, depending on the configured SelectionMode. Use AddListBox(double, double, double, double) to add a list box to a worksheet, then populate it through Items and configure its selection behavior with SelectionMode.

Namespace: GrapeCity.Documents.Excel.Forms
Assembly: DS.Documents.Excel.dll
Syntax
public interface IListBox : IControl<IListBox>, ISelector<ListBoxItem>, ISelector, ICellLinkControl<int>, ICellLinkControl, IControl
Public Interface IListBox
    Inherits IControl(Of IListBox), ISelector(Of ListBoxItem), ISelector, ICellLinkControl(Of Integer), ICellLinkControl, IControl
Examples
IListBox listBox = worksheet.Controls.AddListBox(50, 100, 120, 80);
listBox.Items.Add(new ListBoxItem("Apple"));
listBox.Items.Add(new ListBoxItem("Orange"));
listBox.SelectionMode = SelectionMode.Extended;
var selectedItems = listBox.SelectedItems;

Properties

Name Description
SelectedItems

Gets the currently selected items.

Returns the collection that represents the current selection in the list box. When the selection mode allows multiple selection, the collection can contain more than one item.

SelectionMode

Gets or sets the selection mode.