A newer version of this page is available. Switch to the current version.

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.2.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.

See Also