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)); }); }