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

Defines the fluent interface for configuring child DropDonwList items.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class DropDownListItemBuilder

Inheritance: objectDropDownListItemBuilder

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 DropDownListItemBuilder class.

C#
public DropDownListItemBuilder(DropDownListItem item)
Parameters:itemDropDownListItem

The item.

Methods

Define when the item will be expanded on intial render.

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

If true the item will be selected.

Returns:

DropDownListItemBuilder

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

Sets the value for the item.

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

The value.

Returns:

DropDownListItemBuilder

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

Sets the value for the item.

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

The value.

Returns:

DropDownListItemBuilder

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