JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Using the DropDownList Class

As discussed in the In Depth section of this chapter, these controls are the same as list boxes, except that they can support only single selections, and they display their lists in a drop-down manner. This control is supported with the DropDownList class, and here is the inheritance hierarchy of this class:


You can find the notable public properties of DropDownList objects in Table 17.5. (This control has no non-inherited methods or events.) Note that as with other Web server controls, I am not listing the notable properties, methods, and events this class inherits from the Control and WebControl classes—you can find them in Chapter 15, Tables 15.1 to 15.5. This class inherits the ListControl class, and you can find the notable public properties of ListControl objects in Table 16.4, and their notable public events in Table 16.5. (The ListControl class has no non-inherited methods.) Note that the ListControl class's Items property returns a collection of ListItem objects that you can use to access an item in a list box. You can find the notable public properties of ListItem objects in Table 16.6. (The ListItem class has no non-inherited methods or events.)

Table 17.5: Noteworthy public properties of DropDownList objects.




Gets/sets selected item's index.


Gets/sets the tool tip text for the drop-down list.


Don't forget—if you want to handle this control's events immediately, you must set its AutoPostBack property to True.

Previous Section Next Section

JavaScript Editor Free JavaScript Editor     JavaScript Editor