[]
        
(Showing Draft Content)

IDropDown

Interface IDropDown

All Superinterfaces:
ICellLinkControl, ICellLinkControlT<Integer>, IControl, IControlT<IDropDown>, ISelector, ISelectorT<DropDownItem,IDropDownItemList>

public interface IDropDown extends IControlT<IDropDown>, ISelectorT<DropDownItem,IDropDownItemList>
Represents a drop-down form control.

A drop-down control displays a list of DropDownItem objects and lets users choose a single item from the list. Use IControlCollection.addDropDown(double,double,double,double) to add a drop-down control to a worksheet, then populate it through ISelectorT.getItems() or bind it to a worksheet range through the inherited selector APIs.


 IDropDown dropDown = worksheet.getControls().addDropDown(20, 20, 120, 20);
 dropDown.getItems().add(new DropDownItem("Pending"));
 dropDown.getItems().add(new DropDownItem("Approved"));
 dropDown.setDropDownLines(4);
 dropDown.setSelectedIndex(0);
 
  • Method Details

    • getDropDownLines

      int getDropDownLines()
      Gets the number of items displayed when the drop-down list is expanded.

      Use setDropDownLines(int) to change the value.

      
       IDropDown dropDown = worksheet.getControls().addDropDown(20, 20, 120, 20);
       dropDown.getItems().add(new DropDownItem("Pending"));
       dropDown.getItems().add(new DropDownItem("Approved"));
       dropDown.setDropDownLines(4);
       int lines = dropDown.getDropDownLines();
       
      Returns:
      The number of items displayed when the drop-down list is expanded. Returns 8 if the value has not been set explicitly.
    • setDropDownLines

      void setDropDownLines(int value)
      Sets the number of items displayed when the drop-down list is expanded.
      
       IDropDown dropDown = worksheet.getControls().addDropDown(20, 20, 120, 20);
       dropDown.getItems().add(new DropDownItem("Pending"));
       dropDown.getItems().add(new DropDownItem("Approved"));
       dropDown.setDropDownLines(4);
       
      Parameters:
      value - The number of items displayed when the drop-down list is expanded. The default value is 8 if the value has not been set explicitly.