Back to Devexpress

DropDownBoxBuilder.Value(Object) Method

aspnetcore-devextreme-dot-aspnet-dot-mvc-dot-builders-dot-dropdownboxbuilder-dot-value-x28-system-dot-object-x29.md

latest2.0 KB
Original Source

DropDownBoxBuilder.Value(Object) Method

Specifies the selected value. This can be an object if dataSource contains objects, the store key is specified, and valueExpr is not set. Mirrors the client-side value option.

Namespace : DevExtreme.AspNet.Mvc.Builders

Assembly : DevExtreme.AspNet.Core.dll

Declaration

csharp
public DropDownBoxBuilder Value(
    object value
)

Parameters

NameTypeDescription
valueObject

The option value.

|

Returns

TypeDescription
DropDownBoxBuilder

A reference to this instance after the method is called.

|

Remarks

Use the following notation to set the option’s value:

cshtml
@(Html.DevExtreme().DropDownBox()
    .Value("MyValue")
)

Note

If you synchronize Value with the embedded component’s SelectedRowKeys / SelectedItemKeys property (for instance, DataGridBuilder.SelectedRowKeys), ensure the Value type matches the SelectedRowKeys / SelectedItemKeys type (such as JS Array).

See Also

DevExtreme DropDownBox - Synchronize with the Embedded Element

DropDownBoxBuilder Class

DropDownBoxBuilder Members

DevExtreme.AspNet.Mvc.Builders Namespace