SelectList Constructor
Initializes a new instance of the SelectList class.
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
| Name | Description | |
|---|---|---|
![]() | 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 Constructor (IEnumerable)
Initializes a new instance of the SelectList class by using the specified items for the list.
Parameters
- items
-
Type:
System.Collections.IEnumerable
The items.
SelectList Constructor (IEnumerable, Object)
Initializes a new instance of the SelectList class by using the specified items for the list and a selected value.
Parameters
- items
-
Type:
System.Collections.IEnumerable
The items.
- selectedValue
-
Type:
System.Object
The selected value.
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.
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.
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.
Parameters
- items
-
Type:
System.Collections.IEnumerable
The items.
- dataValueField
-
Type:
System.String
The data value field.
- dataTextField
-
Type:
System.String
The data text field.
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.
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.
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.
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.
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.
