Class MultiSelectList
Represents a list of items that users can select more than one item from.
public class MultiSelectList : IEnumerable<SelectListItem>, IEnumerable
- Inheritance
-
MultiSelectList
- Implements
- Derived
- Inherited Members
Constructors
MultiSelectList(IEnumerable)
Initializes a new instance of the MultiSelectList class by using the specified items to include in the list.
public MultiSelectList(IEnumerable items)
Parameters
items
IEnumerableThe items.
Exceptions
- ArgumentNullException
The
items
parameter is null.
MultiSelectList(IEnumerable, IEnumerable)
Initializes a new instance of the MultiSelectList class by using the specified items to include in the list and the selected values.
public MultiSelectList(IEnumerable items, IEnumerable selectedValues)
Parameters
items
IEnumerableThe items.
selectedValues
IEnumerableThe selected values.
Exceptions
- ArgumentNullException
The
items
parameter is null.
MultiSelectList(IEnumerable, IEnumerable, IEnumerable)
Initializes a new instance of the MultiSelectList class by using the items to include in the list, the selected values, the disabled values.
public MultiSelectList(IEnumerable items, IEnumerable selectedValues, IEnumerable disabledValues)
Parameters
items
IEnumerableThe items used to build each SelectListItem of the list.
selectedValues
IEnumerableThe selected values field. Used to match the Selected property of the corresponding SelectListItem.
disabledValues
IEnumerableThe disabled values. Used to match the Disabled property of the corresponding SelectListItem.
MultiSelectList(IEnumerable, string, string)
Initializes a new instance of the MultiSelectList class by using the items to include in the list, the data value field, and the data text field.
public MultiSelectList(IEnumerable items, string dataValueField, string dataTextField)
Parameters
items
IEnumerableThe items.
dataValueField
stringThe data value field.
dataTextField
stringThe data text field.
Exceptions
- ArgumentNullException
The
items
parameter is null.
MultiSelectList(IEnumerable, string, string, IEnumerable)
Initializes a new instance of the MultiSelectList class by using the items to include in the list, the data value field, the data text field, and the selected values.
public MultiSelectList(IEnumerable items, string dataValueField, string dataTextField, IEnumerable selectedValues)
Parameters
items
IEnumerableThe items.
dataValueField
stringThe data value field.
dataTextField
stringThe data text field.
selectedValues
IEnumerableThe selected values.
Exceptions
- ArgumentNullException
The
items
parameter is null.
MultiSelectList(IEnumerable, string, string, IEnumerable, IEnumerable)
Initializes a new instance of the MultiSelectList class by using the items to include in the list, the data value field, the data text field, the selected values, and the disabled values.
public MultiSelectList(IEnumerable items, string dataValueField, string dataTextField, IEnumerable selectedValues, IEnumerable disabledValues)
Parameters
items
IEnumerableThe items used to build each SelectListItem of the list.
dataValueField
stringThe data value field. Used to match the Value property of the corresponding SelectListItem.
dataTextField
stringThe data text field. Used to match the Text property of the corresponding SelectListItem.
selectedValues
IEnumerableThe selected values field. Used to match the Selected property of the corresponding SelectListItem.
disabledValues
IEnumerableThe disabled values. Used to match the Disabled property of the corresponding SelectListItem.
MultiSelectList(IEnumerable, string, string, string)
Initializes a new instance of the MultiSelectList class by using the items to include in the list, the data value field, the data text field, and the data group field.
public MultiSelectList(IEnumerable items, string dataValueField, string dataTextField, string dataGroupField)
Parameters
items
IEnumerableThe items used to build each SelectListItem of the list.
dataValueField
stringThe data value field. Used to match the Value property of the corresponding SelectListItem.
dataTextField
stringThe data text field. Used to match the Text property of the corresponding SelectListItem.
dataGroupField
stringThe data group field. Used to match the Group property of the corresponding SelectListItem.
MultiSelectList(IEnumerable, string, string, string, IEnumerable)
Initializes a new instance of the MultiSelectList class by using the items to include in the list, the data value field, the data text field, the data group field, and the selected values.
public MultiSelectList(IEnumerable items, string dataValueField, string dataTextField, string dataGroupField, IEnumerable selectedValues)
Parameters
items
IEnumerableThe items used to build each SelectListItem of the list.
dataValueField
stringThe data value field. Used to match the Value property of the corresponding SelectListItem.
dataTextField
stringThe data text field. Used to match the Text property of the corresponding SelectListItem.
dataGroupField
stringThe data group field. Used to match the Group property of the corresponding SelectListItem.
selectedValues
IEnumerableThe selected values field. Used to match the Selected property of the corresponding SelectListItem.
MultiSelectList(IEnumerable, string, string, string, IEnumerable, IEnumerable)
Initializes a new instance of the MultiSelectList class by using the items to include in the list, the data value field, the data text field, the data group field, the selected values, and the disabled values.
public MultiSelectList(IEnumerable items, string dataValueField, string dataTextField, string dataGroupField, IEnumerable selectedValues, IEnumerable disabledValues)
Parameters
items
IEnumerableThe items used to build each SelectListItem of the list.
dataValueField
stringThe data value field. Used to match the Value property of the corresponding SelectListItem.
dataTextField
stringThe data text field. Used to match the Text property of the corresponding SelectListItem.
dataGroupField
stringThe data group field. Used to match the Group property of the corresponding SelectListItem.
selectedValues
IEnumerableThe selected values field. Used to match the Selected property of the corresponding SelectListItem.
disabledValues
IEnumerableThe disabled values. Used to match the Disabled property of the corresponding SelectListItem.
MultiSelectList(IEnumerable, string, string, string, IEnumerable, IEnumerable, IEnumerable)
Initializes a new instance of the MultiSelectList class by using the items to include in the list, the data value field, the data text field, the data group field, the selected values, the disabled values, and the disabled groups.
public MultiSelectList(IEnumerable items, string dataValueField, string dataTextField, string dataGroupField, IEnumerable selectedValues, IEnumerable disabledValues, IEnumerable disabledGroups)
Parameters
items
IEnumerableThe items used to build each SelectListItem of the list.
dataValueField
stringThe data value field. Used to match the Value property of the corresponding SelectListItem.
dataTextField
stringThe data text field. Used to match the Text property of the corresponding SelectListItem.
dataGroupField
stringThe data group field. Used to match the Group property of the corresponding SelectListItem.
selectedValues
IEnumerableThe selected values field. Used to match the Selected property of the corresponding SelectListItem.
disabledValues
IEnumerableThe disabled values. Used to match the Disabled property of the corresponding SelectListItem.
disabledGroups
IEnumerableThe disabled groups. Used to match the Disabled property of the corresponding SelectListGroup.
Properties
DataGroupField
Gets the data group field.
public string DataGroupField { get; }
Property Value
DataTextField
Gets or sets the data text field.
public string DataTextField { get; }
Property Value
- string
The data text field.
DataValueField
Gets or sets the data value field.
public string DataValueField { get; }
Property Value
- string
The data value field.
DisabledGroups
Gets the disabled groups.
public IEnumerable DisabledGroups { get; }
Property Value
DisabledValues
Gets the disabled values.
public IEnumerable DisabledValues { get; }
Property Value
Items
Gets or sets the items in the list.
public IEnumerable Items { get; }
Property Value
- IEnumerable
The items in the list.
SelectedValues
Gets or sets the selected values.
public IEnumerable SelectedValues { get; }
Property Value
- IEnumerable
The selected values.
Methods
GetEnumerator()
Returns an enumerator that can be used to iterate through the collection.
public virtual IEnumerator<SelectListItem> GetEnumerator()
Returns
- IEnumerator<SelectListItem>
An enumerator that can be used to iterate through the collection.