asp.net.ph

DropDownList Class

System.Web.UI.WebControls Namespace


Renders a control that allows the user to select a single item from a drop-down list.

DropDownList Class Members

Collapse   Constructors

Visibility Constructor Parameters
public DropDownList ( )

Collapse   Properties

Visibility Name Value Type Accessibility
public BorderColor Color [ Get , Set ]
public BorderStyle BorderStyle [ Get , Set ]
public BorderWidth Unit [ Get , Set ]
public SelectedIndex Int32 [ Get , Set ]
public SupportsDisabledAttribute Boolean [ Get ]

Collapse   Methods

Visibility Name Parameters Return Type
protected AddAttributesToRender ( HtmlTextWriter writer ) Void
protected CreateControlCollection ( ) ControlCollection
protected LoadPostData ( String postDataKey , NameValueCollection postCollection ) Boolean
protected RaisePostDataChangedEvent ( ) Void

Remarks

Use the DropDownList control to create a single selection drop-down list control.

Like all controls that derive from the ListControl base class, the DropDownList can display content declared at design time, or dynamically bound from a data source at run time.

To specify the items you want to appear in the control, declare a ListItem object for each entry, between the opening and closing tags of the control.

To bind the control to a data source, create or specify the source, then use the DataBind method ( inherited from the base Control class ) to populate the contents of the control.

You can use any supported enumerable collection of data, such as those from datareaders, datasets, datatables, dataviews, arraylists, and so on.

The DropDownList includes a SelectedIndex property, which you use to programmatically specify or determine the index of the item selected by the user from the control.

NOTE: Certain properties inherited from the base WebControl class are not applicable to the DropDownList. These include the BorderColor, BorderStyle, BorderWidth and ToolTip properties.

For examples illustrating use of this control, see the individual member types of this class. For syntax information, see DropDownList in ASP.NET Syntax for Web Controls.

See Also

ListBox, ListControl, ListItem Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph