SelectList Class

 

Represents a list that lets users select one item.

Namespace:   System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

Inheritance Hierarchy

System.Object
  System.Web.Mvc.MultiSelectList
    System.Web.Mvc.SelectList

Syntax

public class SelectList : MultiSelectList
public ref class SelectList : MultiSelectList
type SelectList = 
    class
        inherit MultiSelectList
    end
Public Class SelectList
    Inherits MultiSelectList

Constructors

Name Description
System_CAPS_pubmethod SelectList(IEnumerable)

Initializes a new instance of the SelectList class by using the specified items for the list.

System_CAPS_pubmethod SelectList(IEnumerable, Object)

Initializes a new instance of the SelectList class by using the specified items for the list and a selected value.

System_CAPS_pubmethod SelectList(IEnumerable, Object, IEnumerable)

Initializes a new instance of the SelectList class by using the specified items for the list, the selected value, and the disabled values.

System_CAPS_pubmethod SelectList(IEnumerable, String, String)

Initializes a new instance of the SelectList class by using the specified items for the list, the data value field, and the data text field.

System_CAPS_pubmethod SelectList(IEnumerable, String, String, Object)

Initializes a new instance of the SelectList class by using the specified items for the list, the data value field, the data text field, and a selected value.

System_CAPS_pubmethod SelectList(IEnumerable, String, String, Object, IEnumerable)

Initializes a new instance of the SelectList class by using the specified items for the list, the data value field, the data text field, the selected value, and the disabled values.

System_CAPS_pubmethod SelectList(IEnumerable, String, String, String, Object)

Initializes a new instance of the SelectList class by using the specified items for the list, the data value field, the data text field, the data group field, and the selected value.

System_CAPS_pubmethod SelectList(IEnumerable, String, String, String, Object, IEnumerable)

Initializes a new instance of the SelectList class by using the specified items for the list, the data value field, the data text field, the data group field, the selected value, and the disabled values.

System_CAPS_pubmethod SelectList(IEnumerable, String, String, String, Object, IEnumerable, IEnumerable)

Initializes a new instance of the SelectList class by using the specified items for the list, the data value field, the data text field, the data group field. the selected value, the disabled values, and the disabled groups.

Properties

Name Description
System_CAPS_pubproperty DataGroupField

Gets the data group field.(Inherited from MultiSelectList.)

System_CAPS_pubproperty DataTextField

Gets or sets the data text field.(Inherited from MultiSelectList.)

System_CAPS_pubproperty DataValueField

Gets or sets the data value field.(Inherited from MultiSelectList.)

System_CAPS_pubproperty DisabledGroups

Gets the disabled groups.(Inherited from MultiSelectList.)

System_CAPS_pubproperty DisabledValues

Gets the disabled values.(Inherited from MultiSelectList.)

System_CAPS_pubproperty Items

Gets or sets the items in the list.(Inherited from MultiSelectList.)

System_CAPS_pubproperty SelectedValue

Gets the list value that was selected by the user.

System_CAPS_pubproperty SelectedValues

Gets or sets the selected values.(Inherited from MultiSelectList.)

Methods

Name Description
System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_pubmethod GetEnumerator()

Returns an enumerator that can be used to iterate through the collection.(Inherited from MultiSelectList.)

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethod ToString()

(Inherited from Object.)

Explicit Interface Implementations

Name Description
System_CAPS_pubinterfaceSystem_CAPS_privmethod IEnumerable.GetEnumerator()

Returns an enumerator can be used to iterate through a collection.(Inherited from MultiSelectList.)

Extension Methods

Name Description
System_CAPS_pubmethod AsSerializable<SelectListItem>()

Convenience API to allow an IEnumerable{T} (such as returned by Linq2Sql) to be serialized by DataContractSerilizer.(Defined by IEnumerableExtensions.)

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

System.Web.Mvc Namespace

Return to top