SelectList Constructor

 

Initializes a new instance of the SelectList class.

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

Overload List

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.

See Also

SelectList Class
System.Web.Mvc Namespace

Return to top

SelectList Constructor (IEnumerable)

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

Syntax

public SelectList(
    IEnumerable items
)
public:
SelectList(
    IEnumerable^ items
)
new : 
        items:IEnumerable -> SelectList
Public Sub New (
    items As IEnumerable
)

Parameters

Return to top

SelectList Constructor (IEnumerable, Object)

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

Syntax

public SelectList(
    IEnumerable items,
    object selectedValue
)
public:
SelectList(
    IEnumerable^ items,
    Object^ selectedValue
)
new : 
        items:IEnumerable *
        selectedValue:Object -> SelectList
Public Sub New (
    items As IEnumerable,
    selectedValue As Object
)

Parameters

Return to top

SelectList Constructor (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.

Syntax

public SelectList(
    IEnumerable items,
    object selectedValue,
    IEnumerable disabledValues
)
public:
SelectList(
    IEnumerable^ items,
    Object^ selectedValue,
    IEnumerable^ disabledValues
)
new : 
        items:IEnumerable *
        selectedValue:Object *
        disabledValues:IEnumerable -> SelectList
Public Sub New (
    items As IEnumerable,
    selectedValue As Object,
    disabledValues As IEnumerable
)

Parameters

Return to top

SelectList Constructor (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.

Syntax

public SelectList(
    IEnumerable items,
    string dataValueField,
    string dataTextField
)
public:
SelectList(
    IEnumerable^ items,
    String^ dataValueField,
    String^ dataTextField
)
new : 
        items:IEnumerable *
        dataValueField:string *
        dataTextField:string -> SelectList
Public Sub New (
    items As IEnumerable,
    dataValueField As String,
    dataTextField As String
)

Parameters

Return to top

SelectList Constructor (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.

Syntax

public SelectList(
    IEnumerable items,
    string dataValueField,
    string dataTextField,
    object selectedValue
)
public:
SelectList(
    IEnumerable^ items,
    String^ dataValueField,
    String^ dataTextField,
    Object^ selectedValue
)
new : 
        items:IEnumerable *
        dataValueField:string *
        dataTextField:string *
        selectedValue:Object -> SelectList
Public Sub New (
    items As IEnumerable,
    dataValueField As String,
    dataTextField As String,
    selectedValue As Object
)

Parameters

Return to top

SelectList Constructor (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.

Syntax

public SelectList(
    IEnumerable items,
    string dataValueField,
    string dataTextField,
    object selectedValue,
    IEnumerable disabledValues
)
public:
SelectList(
    IEnumerable^ items,
    String^ dataValueField,
    String^ dataTextField,
    Object^ selectedValue,
    IEnumerable^ disabledValues
)
new : 
        items:IEnumerable *
        dataValueField:string *
        dataTextField:string *
        selectedValue:Object *
        disabledValues:IEnumerable -> SelectList
Public Sub New (
    items As IEnumerable,
    dataValueField As String,
    dataTextField As String,
    selectedValue As Object,
    disabledValues As IEnumerable
)

Parameters

Return to top

SelectList Constructor (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.

Syntax

public SelectList(
    IEnumerable items,
    string dataValueField,
    string dataTextField,
    string dataGroupField,
    object selectedValue
)
public:
SelectList(
    IEnumerable^ items,
    String^ dataValueField,
    String^ dataTextField,
    String^ dataGroupField,
    Object^ selectedValue
)
new : 
        items:IEnumerable *
        dataValueField:string *
        dataTextField:string *
        dataGroupField:string *
        selectedValue:Object -> SelectList
Public Sub New (
    items As IEnumerable,
    dataValueField As String,
    dataTextField As String,
    dataGroupField As String,
    selectedValue As Object
)

Parameters

Return to top

SelectList Constructor (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.

Syntax

public SelectList(
    IEnumerable items,
    string dataValueField,
    string dataTextField,
    string dataGroupField,
    object selectedValue,
    IEnumerable disabledValues
)
public:
SelectList(
    IEnumerable^ items,
    String^ dataValueField,
    String^ dataTextField,
    String^ dataGroupField,
    Object^ selectedValue,
    IEnumerable^ disabledValues
)
new : 
        items:IEnumerable *
        dataValueField:string *
        dataTextField:string *
        dataGroupField:string *
        selectedValue:Object *
        disabledValues:IEnumerable -> SelectList
Public Sub New (
    items As IEnumerable,
    dataValueField As String,
    dataTextField As String,
    dataGroupField As String,
    selectedValue As Object,
    disabledValues As IEnumerable
)

Parameters

Return to top

SelectList Constructor (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.

Syntax

public SelectList(
    IEnumerable items,
    string dataValueField,
    string dataTextField,
    string dataGroupField,
    object selectedValue,
    IEnumerable disabledValues,
    IEnumerable disabledGroups
)
public:
SelectList(
    IEnumerable^ items,
    String^ dataValueField,
    String^ dataTextField,
    String^ dataGroupField,
    Object^ selectedValue,
    IEnumerable^ disabledValues,
    IEnumerable^ disabledGroups
)
new : 
        items:IEnumerable *
        dataValueField:string *
        dataTextField:string *
        dataGroupField:string *
        selectedValue:Object *
        disabledValues:IEnumerable *
        disabledGroups:IEnumerable -> SelectList
Public Sub New (
    items As IEnumerable,
    dataValueField As String,
    dataTextField As String,
    dataGroupField As String,
    selectedValue As Object,
    disabledValues As IEnumerable,
    disabledGroups As IEnumerable
)

Parameters

Return to top