SelectList Constructor

 

Initializes a new instance of the SelectList class.

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

NameDescription
System_CAPS_pubmethodSelectList(IEnumerable)

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

System_CAPS_pubmethodSelectList(IEnumerable, Object)

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

System_CAPS_pubmethodSelectList(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_pubmethodSelectList(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_pubmethodSelectList(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_pubmethodSelectList(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_pubmethodSelectList(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_pubmethodSelectList(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_pubmethodSelectList(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.

Return to top

SelectList Constructor (IEnumerable)

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

public SelectList(
	IEnumerable items
)

Parameters

items
Type: System.Collections.IEnumerable

The items.

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.

public SelectList(
	IEnumerable items,
	object selectedValue
)

Parameters

items
Type: System.Collections.IEnumerable

The items.

selectedValue
Type: System.Object

The selected value.

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.

public SelectList(
	IEnumerable items,
	object selectedValue,
	IEnumerable disabledValues
)

Parameters

items
Type: System.Collections.IEnumerable

The items used to build each SelectListItem of the list.

selectedValue
Type: System.Object

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

disabledValues
Type: System.Collections.IEnumerable

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

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.

public SelectList(
	IEnumerable items,
	string dataValueField,
	string dataTextField
)

Parameters

items
Type: System.Collections.IEnumerable

The items.

dataValueField
Type: System.String

The data value field.

dataTextField
Type: System.String

The data text field.

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.

public SelectList(
	IEnumerable items,
	string dataValueField,
	string dataTextField,
	object selectedValue
)

Parameters

items
Type: System.Collections.IEnumerable

The items.

dataValueField
Type: System.String

The data value field.

dataTextField
Type: System.String

The data text field.

selectedValue
Type: System.Object

The selected value.

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.

public SelectList(
	IEnumerable items,
	string dataValueField,
	string dataTextField,
	object selectedValue,
	IEnumerable disabledValues
)

Parameters

items
Type: System.Collections.IEnumerable

The items used to build each SelectListItem of the list.

dataValueField
Type: System.String

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

dataTextField
Type: System.String

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

selectedValue
Type: System.Object

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

disabledValues
Type: System.Collections.IEnumerable

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

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.

public SelectList(
	IEnumerable items,
	string dataValueField,
	string dataTextField,
	string dataGroupField,
	object selectedValue
)

Parameters

items
Type: System.Collections.IEnumerable

The items used to build each SelectListItem of the list.

dataValueField
Type: System.String

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

dataTextField
Type: System.String

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

dataGroupField
Type: System.String

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

selectedValue
Type: System.Object

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

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.

public SelectList(
	IEnumerable items,
	string dataValueField,
	string dataTextField,
	string dataGroupField,
	object selectedValue,
	IEnumerable disabledValues
)

Parameters

items
Type: System.Collections.IEnumerable

The items used to build each SelectListItem of the list.

dataValueField
Type: System.String

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

dataTextField
Type: System.String

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

dataGroupField
Type: System.String

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

selectedValue
Type: System.Object

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

disabledValues
Type: System.Collections.IEnumerable

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

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.

public SelectList(
	IEnumerable items,
	string dataValueField,
	string dataTextField,
	string dataGroupField,
	object selectedValue,
	IEnumerable disabledValues,
	IEnumerable disabledGroups
)

Parameters

items
Type: System.Collections.IEnumerable

The items used to build each SelectListItem of the list.

dataValueField
Type: System.String

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

dataTextField
Type: System.String

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

dataGroupField
Type: System.String

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

selectedValue
Type: System.Object

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

disabledValues
Type: System.Collections.IEnumerable

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

disabledGroups
Type: System.Collections.IEnumerable

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

Return to top
Show: