This question is locked. New answers and comments are not allowed.
Hello all,
I have one RadComboBox in my screen and I load the items from one table using one query in my screen:
When I create the RadComboBoxItem,
UnauthorizedAccessException was unhandled by user code
Invalid cross-thread access.
What I'm doing wrong???
How can I use Databind to put the data from the table (query) to the control RadComboBox??
Thanks.
I have one RadComboBox in my screen and I load the items from one table using one query in my screen:
private void Servicos_Loaded(object sender, RoutedEventArgs e) { var objDataContext = (IContentItem)this.DataContext; var Screen = (Microsoft.LightSwitch.Client.IScreenObject)objDataContext.Screen; Screen.Details.Dispatcher.BeginInvoke(() => { var serviceResources = (Screen as EditableScheduleViewApptsGrid).ServiceToAppointment.ToList(); this.actualServiceToAppt = serviceResources; foreach (SERVICE iten in serviceResources) { RadComboBoxItem newItemServ = new RadComboBoxItem(); newItemServ.Content= iten.Name; this.ServicosComboBox.Items.Add(newItemServ); } }); }When I create the RadComboBoxItem,
RadComboBoxItem
newItemServ = new RadComboBoxItem();
I get the error:
UnauthorizedAccessException was unhandled by user code
Invalid cross-thread access.
What I'm doing wrong???
How can I use Databind to put the data from the table (query) to the control RadComboBox??
Thanks.