Hi,
I downloaded patch ............... and I get the following problem (which I didn't have before).
When loading a pivotGrid I get UnauthorizedAccessException at line ( if (e.PropertyName == "Processing")) :
void DataSource_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == "Cubes") { BusyIndicator1.Visibility = Visibility.Collapsed; } if (e.PropertyName == "Processing") { if (pivotGrid.DataSource.Processing) { BusyIndicator1.Visibility = Visibility.Visible; filteringEnabled = false; _finishedLoadingPivot = false; } else {
-----------------------------
{System.UnauthorizedAccessException: Invalid cross-thread access. at MS.Internal.XcpImports.CheckThread() at System.Windows.DependencyObject.GetValueInternal(DependencyProperty dp) at System.Windows.FrameworkElement.GetValueInternal(DependencyProperty dp) at System.Windows.DependencyObject.GetValue(DependencyProperty dp) at Infragistics.Controls.Grids.XamPivotGrid.get_DataSource() at cockpitR2.Controls.DVControls.PivotGridBaseControl.DataSource_PropertyChanged(Object sender, PropertyChangedEventArgs e) at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e) at Infragistics.Olap.DataSourceBase.OnPropertyChanged(String propertyName) at Infragistics.Olap.DataSourceBase.set_Processing(Boolean value) at Infragistics.Olap.DataSourceBase.FilterViewModel_PropertyChanged(Object sender, PropertyChangedEventArgs e) at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e) at Infragistics.Olap.ViewModelBase.OnPropertyChanged(String propertyName) at Infragistics.Olap.FilterViewModelBase.set_IsLoadingMembers(Boolean value) at Infragistics.Olap.FilterViewModelBase.AttachToProvider() at Infragistics.Olap.FilterViewModelBase.FilterMemberPropertyChanged(Object sender, PropertyChangedEventArgs e) at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e) at Infragistics.Olap.Data.Base.FilterMember.OnPropertyChanged(String propertyName) at Infragistics.Olap.Data.Base.FilterMember.set_IsExpanded(Boolean value) at cockpitR2.Controls.DVControlsSerializers.SavedPivotGridView.ExpandMembers(IFilterViewModel filterViewModel, IFilterMember filterMember) at cockpitR2.Controls.DVControlsSerializers.SavedPivotGridView.<pivotGrid_LayoutLoaded>b__0(Object s, DoWorkEventArgs evt) at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.OnRun(Object argument)}
Hello,
Could you specify both the old and the new version? Also you can help us to resolve that issue faster if it's possible to send us how the call stack looks like at that point with the old version. What I see in the call stack is that the exception occurs at this line:
code line:if (pivotGrid.DataSource.Processing)
call stack line:at Infragistics.Controls.Grids.XamPivotGrid.get_DataSource()
Also your code is running using the background thread of the worker you've started. XamPivotGrid.DataSource is dependency property and that's why this exception is thrown.Thanks.Plamen.
Old version XamPivotGrid = 11.1.20111.1004 (works ok)
New version XamPivotGrid = 11.1.20111.2097
I can't send you an old stack trace as I installed the service release.
At the old release it worked with no problems without the exception.
So I want to ask what is changed and what I should do in order to solve my issue.
What was changed is now you can expect Processing to be changed to true while the filter member is loading its child members and is changed back to false once the loading is finished. This notification was missing in the earlier versions and that’s why the change of Processing in your code was always reported in the main thread, whereas in the latest version this notification also occurs when filter member starts and finishes the loading of its children. That change in your code runs in the background thread. Accessing the dependency properties through Dispatcher should fix that.
Plamen.
We finally used ThreadPool.QueueUserWorkItem for the DataSource_PropertyChange and works fine.