Skip to main content
All docs
V24.1

RepositoryItemTokenEdit.ValueMember Property

If the Token Edit is connected to a data source, this property specifies which data source field stores unique Token values.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[DefaultValue("")]
[DXCategory("Data")]
public string ValueMember { get; set; }

Property Value

Type Default Description
String String.Empty

The name of a data source field that stores Token values.

Remarks

The DataSource property allows you to connect the editor to an external data source. Additionally, you need to set up two properties:

At design time, use the control’s smart tag menu to set up all three properties.

Data-bound properties of TokenEdit at design time

Tokens retrieved from a data source are not stored in the RepositoryItemTokenEdit.Tokens collection – this collection is always empty for a data-aware Token Edit.

If a data-aware Token Edit operates in “Manual” mode (see the EditMode property), users who type new values into the editor text box trigger the ProcessNewValue event. This event is similar to the ValidateToken event that raises for unbound Token Edit controls under same circumstances. It allows you to inspect the entered text (the e.Text property) and, if this text is valid, post it to a data source.

//a regular expression to validate entered values
Regex MyRegex = ...;

void TokenEdit1_ProcessNewValue(object sender, TokenEditProcessNewValueEventArgs e) {
    if (MyRegex.IsMatch(e.Text)) {
        //use data source API to post changes
        e.Handled = true;
    }
}

For more information on Token Edit, see the following help topic: Token Edit Control.

See Also