Programming Microsoft ASP.NET 4 - Dino Esposito [222]
Items
Gets the collection of items in the list control
SelectedIndex
Gets or sets the index of the selected item in the list
SelectedItem
Gets the selected item in the list
SelectedValue
Gets the value of the selected item in the list
The DropDownList control, as well as many other server controls, features some properties to configure the graphical aspect of the final markup. At rendering time, these properties are transformed in cascading style sheet (CSS) style properties. The best practice today is to avoid style properties such as BorderColor and ForeColor and use CSS classes instead. Whenever possible and suitable, you should adhere to this de facto standard and emit plain HTML markup out of server controls.
The DataTextField and DataValueField properties don’t accept expressions, only plain property names. If you need to combine and display two or more fields from the data source, it is recommended that you preprocess that data at the source and bind data already in a display format.
Note
The ASP.NET DropDownList control doesn’t support groups of options as provided by the HTML