[]
        
(Showing Draft Content)

ListBoxItem

Class ListBoxItem

java.lang.Object
com.grapecity.documents.excel.forms.SelectorItem
com.grapecity.documents.excel.forms.ListBoxItem

public class ListBoxItem extends SelectorItem
Represents an item in a IListBox.

A ListBoxItem stores the display value used by a list box control. Create instances of this class and add them to ISelectorT.getItems() to populate the available choices.


 IListBox listBox = worksheet.getControls().addListBox(20, 20, 120, 80);
 ListBoxItem item = new ListBoxItem("Item 1");
 listBox.getItems().add(item);
 
  • Constructor Details

    • ListBoxItem

      public ListBoxItem()
      Creates an empty item.

      Use this constructor to create a ListBoxItem without an initial value, and then assign its content by calling SelectorItem.setValue(String) before adding it to ISelectorT.getItems().

      
       IListBox listBox = worksheet.getControls().addListBox(20, 20, 120, 80);
       ListBoxItem item = new ListBoxItem();
       item.setValue("North");
       listBox.getItems().add(item);
       
    • ListBoxItem

      public ListBoxItem(String value)
      Creates a list box item with the specified value.

      This constructor initializes the item by passing value to SelectorItem.setValue(String).

      
       IListBox listBox = worksheet.getControls().addListBox(20, 20, 120, 80);
       listBox.getItems().add(new ListBoxItem("North"));
       
      Parameters:
      value - The item value. Can be null.