[]
        
(Showing Draft Content)

DropDownItem

Class DropDownItem

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

public class DropDownItem extends SelectorItem
Represents an item in an IDropDown control.

Use this class to create items programmatically and add them to a drop-down item collection. A DropDownItem inherits common selector-item behavior, such as item value and read-only state, from SelectorItem.


 IDropDown dropDown = worksheet.getControls().addDropDown(20, 20, 120, 20);
 DropDownItem item = new DropDownItem("Pending");
 dropDown.getItems().add(item);
 
  • Constructor Details

    • DropDownItem

      public DropDownItem()
      Creates an empty item.

      Use this constructor to create a DropDownItem without an initial value, and then set the item value later before adding it to an IDropDown.

      
       DropDownItem item = new DropDownItem();
       item.setValue("Pending");
       
    • DropDownItem

      public DropDownItem(String value)
      Creates an item with value.

      This constructor initializes the item by setting its value.

      
       IDropDown dropDown = worksheet.getControls().addDropDown(20, 20, 120, 20);
       DropDownItem item = new DropDownItem("Pending");
       dropDown.getItems().add(item);
       
      Parameters:
      value - The value of item.