Dela via


SelectList Constructors

Definition

Overloads

SelectList(IEnumerable)

Initialize a new instance of SelectList.

SelectList(IEnumerable, Object)

Initialize a new instance of SelectList.

SelectList(IEnumerable, String, String)

Initialize a new instance of SelectList.

SelectList(IEnumerable, String, String, Object)

Initialize a new instance of SelectList.

SelectList(IEnumerable, String, String, Object, String)

Initializes a new instance of the SelectList class by using the specified items for the list, the data value field, the data text field, a selected value, and the data group field.

SelectList(IEnumerable)

Source:
SelectList.cs
Source:
SelectList.cs
Source:
SelectList.cs

Initialize a new instance of SelectList.

public:
 SelectList(System::Collections::IEnumerable ^ items);
public SelectList (System.Collections.IEnumerable items);
new Microsoft.AspNetCore.Mvc.Rendering.SelectList : System.Collections.IEnumerable -> Microsoft.AspNetCore.Mvc.Rendering.SelectList
Public Sub New (items As IEnumerable)

Parameters

items
IEnumerable

The items.

Applies to

SelectList(IEnumerable, Object)

Source:
SelectList.cs
Source:
SelectList.cs
Source:
SelectList.cs

Initialize a new instance of SelectList.

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

Parameters

items
IEnumerable

The items.

selectedValue
Object

The selected value.

Applies to

SelectList(IEnumerable, String, String)

Source:
SelectList.cs
Source:
SelectList.cs
Source:
SelectList.cs

Initialize a new instance of SelectList.

public:
 SelectList(System::Collections::IEnumerable ^ items, System::String ^ dataValueField, System::String ^ dataTextField);
public SelectList (System.Collections.IEnumerable items, string dataValueField, string dataTextField);
new Microsoft.AspNetCore.Mvc.Rendering.SelectList : System.Collections.IEnumerable * string * string -> Microsoft.AspNetCore.Mvc.Rendering.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)

Source:
SelectList.cs
Source:
SelectList.cs
Source:
SelectList.cs

Initialize a new instance of SelectList.

public:
 SelectList(System::Collections::IEnumerable ^ items, System::String ^ dataValueField, System::String ^ dataTextField, System::Object ^ selectedValue);
public SelectList (System.Collections.IEnumerable items, string dataValueField, string dataTextField, object selectedValue);
new Microsoft.AspNetCore.Mvc.Rendering.SelectList : System.Collections.IEnumerable * string * string * obj -> Microsoft.AspNetCore.Mvc.Rendering.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, String)

Source:
SelectList.cs
Source:
SelectList.cs
Source:
SelectList.cs

Initializes a new instance of the SelectList class by using the specified items for the list, the data value field, the data text field, a selected value, and the data group field.

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

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 values. Used to match the Selected property of the corresponding SelectListItem.

dataGroupField
String

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

Applies to