Search code examples
vb.netautocompletedevexpressxpogridlookupedit

Devexpress lookup edit select one fill in rest lookups


I'm working on program which uses xpo collection to get and update data from and to database. I setted up lookupedit to get data from another database(country name) I would like another lookupedit (country code) to be filled in automatically after country name is selected.

Here is XPO collection:

Private Countries As New XPCollection(Of clCountry)(UOW)

and here is lookup code:

CountriesLookupRepo.DataSourceConnect("Name", "Name", Countries)
CountryCodeLookUp.DataSourceConnect("ISO2", "ISO2", Countries)

How can I link them up so that ISO2 will be filled automatically after Name is selected?

Thanks


Solution

  • Figured out how to do it.

    In case someone else is wondering, this is how I did it :

    Dim Country As clCountry = CountriesLookupRepo.GetDataSourceRowByKeyValue(e.Value)
                    Apt.CountryCode = Country.ISO2
                    Apt.RegionName = Country.Region