Hi guys,
Could you possibly tell me how to instruct LookupEditor to look up on a certain column?
For example, I have a table with 5 columns but whenever I use LookupEditor it will always choose the first column but I would like to use column 3.
Many thanks,
Abu
I think LookupEditor uses the NameField of Entity. If you want to use another column you have to do another Lookup see samples: Northwind \ Costumer \ CustomerCountryLookup.
Just use LookupInclude on the columns you want to be added if you want more... or just alter NameField if it麓s the only field.
thank you both, changing NameField works however I'd like to lookup different columns from different pages so I've added LookupInclude on another column but that doesn't seem to have the desired effect. LookupEditor is still returning only the column defined in NameField. I'm sure I'm missing something here...
To elaborate a bit more...
I have a page called VDIAllocations which loads a form, in this form I have 3 lookupeditors, 1 to lookup region, number 2 looksup city and number 3 looksup up site. all 3 exist in LocationsRow.cs, In LocationsRow.cs I've added LookupInclude in Region and Site fields, NameField is set to City (which works).
In VDIAllocations I've added [LookupEditor(typeof(LocationsRow))], this works for City as expected but for region and site it looksup City which is where I'm struggling with, I don't know how to tell LookupEditor to search on Region and Site.
I managed to figure this out by creating a lookup script but was hoping to avoid doing so by using LookUpInclude, is that possible? And where may I find documentation for LookupEditor? Tried the github book but couldn't find much there about it,
There is even sample to use a custom text for a custom lookup editor.
Most helpful comment
Just use LookupInclude on the columns you want to be added if you want more... or just alter NameField if it麓s the only field.