Skip to main content
A newer version of this page is available.

RepositoryItemLookUpEdit.ThrowExceptionOnInvalidLookUpEditValueType Property

Gets or sets a value specifying the editor’s behavior when assigning a value of an invalid type to the BaseEdit.EditValue property.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v19.1.dll

Declaration

[DXCategory("Behavior")]
[DefaultValue(false)]
public virtual bool ThrowExceptionOnInvalidLookUpEditValueType { get; set; }

Property Value

Type Default Description
Boolean **false**

true if the editor raises an exception when assigning a value of an invalid type; otherwise, false.

Remarks

The lookup control’s edit value type is specified by the type of the associated data source’s key field. The key field is specified by the editor’s RepositoryItemLookUpEditBase.ValueMember property. The ThrowExceptionOnInvalidLookUpEditValueType property specifies the control’s response when a value of an invalid type is assigned to its BaseEdit.EditValue property. Set this property to true to raise an exception each time a value of an invalid type is assigned. If set to false, values of invalid types are ignored by the editor.

You can handle the RepositoryItem.EditValueChanging event to determine the type of the value about to be assigned. You can then correct it as needed. This gives you the ability to custom process the invalid values.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ThrowExceptionOnInvalidLookUpEditValueType 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