SelectList Constructors

Definition

Overloads

SelectList(IEnumerable)

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

SelectList(IEnumerable, Object)

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

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.

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.

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.

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.

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.

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.

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.

SelectList(IEnumerable)

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

public SelectList (System.Collections.IEnumerable items);
new System.Web.Mvc.SelectList : System.Collections.IEnumerable -> System.Web.Mvc.SelectList
Public Sub New (items As IEnumerable)

Parameters

items
IEnumerable

The items.

Applies to

SelectList(IEnumerable, Object)

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

public SelectList (System.Collections.IEnumerable items, object selectedValue);
new System.Web.Mvc.SelectList : System.Collections.IEnumerable * obj -> System.Web.Mvc.SelectList
Public Sub New (items As IEnumerable, selectedValue As Object)

Parameters

items
IEnumerable

The items.

selectedValue
Object

The selected value.

Applies to

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.

public SelectList (System.Collections.IEnumerable items, object selectedValue, System.Collections.IEnumerable disabledValues);
new System.Web.Mvc.SelectList : System.Collections.IEnumerable * obj * System.Collections.IEnumerable -> System.Web.Mvc.SelectList
Public Sub New (items As IEnumerable, selectedValue As Object, disabledValues As IEnumerable)

Parameters

items
IEnumerable

The items used to build each SelectListItem of the list.

selectedValue
Object

The selected value. Used to match the Selected property of the corresponding SelectListItem.

disabledValues
IEnumerable

The disabled values. Used to match the Disabled property of the corresponding SelectListItem.

Applies to

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.

public SelectList (System.Collections.IEnumerable items, string dataValueField, string dataTextField);
new System.Web.Mvc.SelectList : System.Collections.IEnumerable * string * string -> System.Web.Mvc.SelectList
Public Sub New (items As IEnumerable, dataValueField As String, dataTextField As String)

Parameters

items
IEnumerable

The items.

dataValueField
String

The data value field.

dataTextField
String

The data text field.

Applies to

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.

public SelectList (System.Collections.IEnumerable items, string dataValueField, string dataTextField, object selectedValue);
new System.Web.Mvc.SelectList : System.Collections.IEnumerable * string * string * obj -> System.Web.Mvc.SelectList
Public Sub New (items As IEnumerable, dataValueField As String, dataTextField As String, selectedValue As Object)

Parameters

items
IEnumerable

The items.

dataValueField
String

The data value field.

dataTextField
String

The data text field.

selectedValue
Object

The selected value.

Applies to

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.

public SelectList (System.Collections.IEnumerable items, string dataValueField, string dataTextField, object selectedValue, System.Collections.IEnumerable disabledValues);
new System.Web.Mvc.SelectList : System.Collections.IEnumerable * string * string * obj * System.Collections.IEnumerable -> System.Web.Mvc.SelectList
Public Sub New (items As IEnumerable, dataValueField As String, dataTextField As String, selectedValue As Object, disabledValues As IEnumerable)

Parameters

items
IEnumerable

The items used to build each SelectListItem of the list.

dataValueField
String

The data value field. Used to match the Value property of the corresponding SelectListItem.

dataTextField
String

The data text field. Used to match the Text property of the corresponding SelectListItem.

selectedValue
Object

The selected value. Used to match the Selected property of the corresponding SelectListItem.

disabledValues
IEnumerable

The disabled values. Used to match the Disabled property of the corresponding SelectListItem.

Applies to

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.

public SelectList (System.Collections.IEnumerable items, string dataValueField, string dataTextField, string dataGroupField, object selectedValue);
new System.Web.Mvc.SelectList : System.Collections.IEnumerable * string * string * string * obj -> System.Web.Mvc.SelectList
Public Sub New (items As IEnumerable, dataValueField As String, dataTextField As String, dataGroupField As String, selectedValue As Object)

Parameters

items
IEnumerable

The items used to build each SelectListItem of the list.

dataValueField
String

The data value field. Used to match the Value property of the corresponding SelectListItem.

dataTextField
String

The data text field. Used to match the Text property of the corresponding SelectListItem.

dataGroupField
String

The data group field. Used to match the Group property of the corresponding SelectListItem.

selectedValue
Object

The selected value. Used to match the Selected property of the corresponding SelectListItem.

Applies to

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.

public SelectList (System.Collections.IEnumerable items, string dataValueField, string dataTextField, string dataGroupField, object selectedValue, System.Collections.IEnumerable disabledValues);
new System.Web.Mvc.SelectList : System.Collections.IEnumerable * string * string * string * obj * System.Collections.IEnumerable -> System.Web.Mvc.SelectList
Public Sub New (items As IEnumerable, dataValueField As String, dataTextField As String, dataGroupField As String, selectedValue As Object, disabledValues As IEnumerable)

Parameters

items
IEnumerable

The items used to build each SelectListItem of the list.

dataValueField
String

The data value field. Used to match the Value property of the corresponding SelectListItem.

dataTextField
String

The data text field. Used to match the Text property of the corresponding SelectListItem.

dataGroupField
String

The data group field. Used to match the Group property of the corresponding SelectListItem.

selectedValue
Object

The selected value. Used to match the Selected property of the corresponding SelectListItem.

disabledValues
IEnumerable

The disabled values. Used to match the Disabled property of the corresponding SelectListItem.

Applies to

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.

public SelectList (System.Collections.IEnumerable items, string dataValueField, string dataTextField, string dataGroupField, object selectedValue, System.Collections.IEnumerable disabledValues, System.Collections.IEnumerable disabledGroups);
new System.Web.Mvc.SelectList : System.Collections.IEnumerable * string * string * string * obj * System.Collections.IEnumerable * System.Collections.IEnumerable -> System.Web.Mvc.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

items
IEnumerable

The items used to build each SelectListItem of the list.

dataValueField
String

The data value field. Used to match the Value property of the corresponding SelectListItem.

dataTextField
String

The data text field. Used to match the Text property of the corresponding SelectListItem.

dataGroupField
String

The data group field. Used to match the Group property of the corresponding SelectListItem.

selectedValue
Object

The selected value. Used to match the Selected property of the corresponding SelectListItem.

disabledValues
IEnumerable

The disabled values. Used to match the Disabled property of the corresponding SelectListItem.

disabledGroups
IEnumerable

The disabled groups. Used to match the Disabled property of the corresponding SelectListGroup.

Applies to