My XtraLookupEdit, allows you to bind a DisplayValue and EditValue
The title might not seem to make sense so I will hopefully describe it better here.
I have a scenario where in my application the User has security restrictions, these restrictions include limiting the list of users they can assign to a record.
This is where the normal LookupEdit has it’s limitations, you can bind the EditValue but if the Lookup list doesn’t contain a record that is currently assigned it gives a blank/null display.
I was going to put a Suggestion/Question in over at the Support Center but I figured I should see what I could do first.
So I created a simple inherited LookupEdit control, I then added my DisplayValue property which would hold the value I want displayed regardless of the EditValue, next was easy to accomplish by just handling the CustomDisplayText event and violla, I bind the ID to the EditValue and the Display property to the DisplayValue.
Public Class XtraLookupEditInherits DevExpress.XtraEditors.LookUpEditPrivate _displayValue As String<System.ComponentModel.Bindable(True)> _Public Property DisplayValue() As StringGetReturn _displayValueEnd GetSet(ByVal Value As String)_displayValue = ValueEnd SetEnd PropertyPublic Sub DisplayText(ByVal sender As Object, ByVal e As DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs) Handles Me.CustomDisplayTexte.DisplayText = DisplayValueEnd SubEnd Class
When I get some more time I will ellaborate more in how this is used however if you have any questions in the mean time don’t hesitate to ask.

Should AussieALF stay bald?
Latest Comments
- How to make XPO only...
Hi Sean, Very true ;) however keep in mi... More...
09-Apr-10 - How to make XPO only...
True, but it's worth noting that DX do ... More...
09-Apr-10 - How to make XPO only...
I would have to check with Gary, as alth... More...
09-Apr-10 - How to make XPO only...
Hi, I agree it seems like a "normal" thi... More...
09-Apr-10 - How to make XPO only...
Another question, how does it work with ... More...
09-Apr-10





