Hi,
i've try to insert the new XamDataGrid 2009.1 in an application that have a thred for refresh it.
The grid is binded to an ObservableCollection of elements the have notifypropertychanged implemented.
The grid raise this error:
XamDataGrid does not support changes (other than ListChangedType.ItemChanged) to its DataSource from a thread different from its Dispatcher thread.
What can i do to solve this problem?
Well, this seems to be the issue. You have to update the grid only from the thread where it lives.
You can do that with BeginInvoke() method.
System.NotSupportedException was caught
Message="XamDataGrid does not support changes (other than ListChangedType.ItemChanged) to its DataSource from a thread different from its Dispatcher thread."
Alex.
This is the detail of the error:
Source="Infragistics3.Wpf.DataPresenter.v9.1"
StackTrace:
in Infragistics.Windows.DataPresenter.RecordManager.OnChangeNotification(Object sender, Object eventArgs, Boolean isReset)
in Infragistics.Windows.DataPresenter.DataRecord.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e)
in System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list)
in System.ComponentModel.PropertyChangedEventManager.OnPropertyChanged(Object sender, PropertyChangedEventArgs args)
in OceanRepository.Modello.CampioniListaRiga.NotifyPropertyChanged(String info) in C:\Progetti\Shark\OceanRepository\Modello\ClVCampioniLista.cs:riga 56
in OceanRepository.Modello.CampioniListaRiga.set_IdCampione(Int32 value) in C:\Progetti\Shark\OceanRepository\Modello\ClVCampioniLista.cs:riga 66
in OceanRepository.Modello.CampioniListaRiga.Popola(OracleDataReader AOdr) in C:\Progetti\Shark\OceanRepository\Modello\ClVCampioniLista.cs:riga 392
in OceanRepository.Modello.CampioniLista.Aggiorna(OracleDataReader AOdr) in C:\Progetti\Shark\OceanRepository\Modello\ClVCampioniLista.cs:riga 603
in OceanRepository.Modello.CampioniLista.Popola(Boolean AAggiorna, Boolean AMessaggio, Object AIdLista, Object AStatoCampione, Object APriorita) in C:\Progetti\Shark\OceanRepository\Modello\ClVCampioniLista.cs:riga 559
InnerException:
Hello,
What error exactly raises the grid.
UI objects should be updated from the thread that created them. In most cases this is the main thread. So make sure that you are on the correct thread in order to update the grid.