Skip to main content
Tab

ASPxGridLookup.Value Property

Gets or sets the value of the selected item key field.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

public override object Value { get; set; }

Property Value

Type Description
Object

A Object value.

Remarks

The Value property contains the value of the field specified via the ASPxGridLookup.KeyFieldName property for the selected item. You can use this property to manipulate an item selected within the ASPxGridLookup control.

If you need to validate the editor’s value before posting it, you can use either the client-side ASPxClientEdit.Validate or server-side ASPxEdit.Validate method, or both. If no validation is performed and the value posted is not correct, then an exception is raised.

refer to the Selection Modes topic, to learn more.

Note

When multiple selection is used (the ASPxGridLookup.SelectionMode property is set to Multiple), the Value property contains the value of the first selected item. In this case, to get and set the selected item values, use the ASPxGridBase.GetSelectedFieldValues and ASPxGridView.Selection members respectively. These members can be accessed via the ASPxGridLookup.GridView property. To learn more, see the Code Central example: How to use ASPxGridLookup in multiple selection mode as the ASPxGridView editor

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Value property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also