New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Defines the fluent interface for configuring child DropDownList items.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class SelectListItemBuilder

Inheritance: objectSelectListItemBuilder

Inherited Members object.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

Initializes a new instance of the SelectListItemBuilder class.

C#
public SelectListItemBuilder(SelectListItem item)
Parameters:itemSelectListItem

The item.

Methods

Define when the item will be selected on intial render.

C#
public SelectListItemBuilder Selected(bool value)
Parameters:valuebool

If true the item will be selected.

Returns:

SelectListItemBuilder

Returns the current SelectListItemBuilder instance.

Example:
C#
@( Html.Kendo().DropDownList()
.Name("DropDownList")
.Items(items => items.Add().Text("First Item").Selected(true))
)

Sets the value for the item.

C#
public SelectListItemBuilder Text(string value)
Parameters:valuestring

The value.

Returns:

SelectListItemBuilder

Returns the current SelectListItemBuilder instance.

Example:
C#
@( Html.Kendo().DropDownList()
.Name("DropDownList")
.Items(items => items.Add().Text("First item."))
)

Sets the value for the item.

C#
public SelectListItemBuilder Value(string value)
Parameters:valuestring

The value.

Returns:

SelectListItemBuilder

Returns the current SelectListItemBuilder instance.

Example:
C#
@( Html.Kendo().DropDownList()
.Name("DropDownList")
.Items(items => items.Add().Value("1"))
)