[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Forms.ISelector

ISelector Interface

Represents a selector control that lets a user choose an item from a list.

This interface provides the common selection members for controls such as IDropDown and IListBox. A selector can populate its choices from Items or bind them to a worksheet range through ItemsSourceRange. When an items source range is set, the items collection is read-only. Through the inherited cell-link members, the current selection value is exposed as SelectedIndex plus 1.

Namespace: GrapeCity.Documents.Excel.Forms
Assembly: DS.Documents.Excel.dll
Syntax
public interface ISelector : ICellLinkControl<int>, ICellLinkControl, IControl
Public Interface ISelector
    Inherits ICellLinkControl(Of Integer), ICellLinkControl, IControl
Examples
ISelector selector = worksheet.Controls.AddDropDown(20, 20, 120, 20);
worksheet.Range["A1:A3"].Value = new object[,] {{"Pending"}, {"Approved"}, {"Rejected"}};
selector.ItemsSourceRange = worksheet.Range["A1:A3"];
selector.SelectedIndex = 1;

Properties

Name Description
ItemsSourceRange

Gets or sets the items source of this control.

This property can't be used if items were added to Items. When an items source range is set, the control reads its items from that worksheet range instead of from the items collection.

This property doesn't handle #REF! errors. #REF! will be treated as an empty collection.

SelectedIndex

Gets or sets the selected index of this control.

Returns the zero-based index of the currently selected item. Returns -1 if no item is selected.

@apiNote Not fully supported by the *.ssjson format.