private void LoadRowsAsync()
        {
            lock (_searchLock)
            {
                LookupGridVisible = false;
                Searching         = true;
                try
                {
                    var records = GetSearchResults();

                    DoOnMainThread(() =>
                    {
                        try
                        {
                            LookupGridViewModel.DynamicGridViewModel.GridRecords = GridRowViewModel.LoadRows(records, LookupGridViewModel.DynamicGridViewModel);
                            OnPropertyChanged(nameof(LookupGridViewModel));
                            Searching         = false;
                            LookupGridVisible = LookupGridViewModel.DynamicGridViewModel.GridRecords.Any();
                        }
                        catch (Exception)
                        {
                            Searching = false;
                            throw;
                        }
                    });
                }
                catch (Exception)
                {
                    Searching = false;
                    throw;
                }
            }
        }
        internal void SetItemsSource(IEnumerable <T> items)
        {
            ItemsSource = items == null ? new SelectablePicklistOption[0] : items.Select(i => new SelectablePicklistOption(i, RefreshSelectedItemsIntoValue, Value != null && Value.Any(v => v == i))).ToArray();
            var optionsObject = new SelectablePicklistOptions()
            {
                Options = ItemsSource
            };
            var recordService = new ObjectRecordService(optionsObject, ApplicationController);
            Func <IEnumerable <IRecord> > getRecordsFunc = () => recordService.RetreiveAll(new QueryDefinition(typeof(SelectablePicklistOption).AssemblyQualifiedName));

            DynamicGridViewModel = new DynamicGridViewModel(ApplicationController)
            {
                ViewType       = ViewType.LookupView,
                FormController = new FormController(recordService, null, ApplicationController),
                RecordType     = typeof(SelectablePicklistOption).AssemblyQualifiedName,
                RecordService  = recordService,
                GetGridRecords = (b) => new GetGridRecordsResponse(getRecordsFunc()),
                IsReadOnly     = true
            };
            Action onClick = () =>
            {
                var selectedItem = DynamicGridViewModel.SelectedRow;
                if (selectedItem != null)
                {
                    var isSelectedField = selectedItem.GetBooleanFieldFieldViewModel(nameof(SelectablePicklistOption.Select));
                    isSelectedField.Value            = !isSelectedField.Value;
                    DynamicGridViewModel.SelectedRow = null;
                }
            };

            DynamicGridViewModel.OnClick = onClick;
            DoOnAsynchThread(() => {
                DynamicGridViewModel.GridRecords = GridRowViewModel.LoadRows(getRecordsFunc(), DynamicGridViewModel);
                OnPropertyChanged(nameof(DynamicGridViewModel));
                OnPropertyChanged(nameof(StringDisplay));
            });
        }