Tab

ListEditProperties.ValueField Property

Gets or sets the data source field that provides values for the editor's items.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v20.2.dll

Declaration

[DefaultValue("")]
public string ValueField { get; set; }
<DefaultValue("")>
Public Property ValueField As String

Property Value

Type Default Description
String

String.Empty

A string value that specifies the name of the data source field from which the editor obtains item values.

Remarks

If a list editor is data bound (via the ListEditProperties.DataSourceID or ListEditProperties.DataSource property), the editor populates its ListEditProperties.Items collection by retrieving items from the specified data source and obtaining item characteristics (such item texts, values or displayed images) from specific data fields. Use the ValueField property to specify a data source's field from which the item values should be obtained.

The ValueField property synchronizes its value with the editor's ASPxListEdit.ValueField property.

NOTE

An item's value (ASPxListEdit.ValueField](xref:DevExpress.Web.ASPxListEdit.ValueField)) should be unique.

Example

list-box-column

<dx:ASPxListBox ID="lbModels" SelectionMode="CheckColumn" EnableSelectAll="true" DataSourceID="PhoneModels" ValueField="ID" ValueType="System.String" ... >
     <CaptionSettings Position="Top" />
     <Columns>
          <dx:ListBoxColumn FieldName="Name" Caption="Model" Width="100%" />
          <dx:ListBoxColumn FieldName="Price" Width="50px" />
     </Columns>
</dx:ASPxListBox>
<asp:XmlDataSource ID="PhoneModels" DataFile="~/App_Data/PhoneModels.xml" XPath="//Model" runat="server" />

For a full example, see List Box with Multiple Selection demo.

See Also