Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
605
Exception on DataSource refresh
posted

Hello,

I have posted same question on Silverlight forum and had no answers. Hope the reason was just wrong forum I've selected to post to...

Here is the original post : 

I have a problem with xamPivotGrid exceptions occurring in the following scenario:

1. Pivot grid is loaded with previously saved layout view.

2. Data Source could be updated from underlying sources (webservices) at any given moment

3. If I then try to add new dimension to the grid from data selector eventually I see

System.InvalidOperationException  exception thrown from InfragisticsWPF4.Olap.FlatData.v11.1 :

 

System.InvalidOperationException was unhandled

Message=Operation is not valid due to the current state of the object.

Source=InfragisticsWPF4.Olap.FlatData.v11.1

StackTrace:

at Infragistics.Olap.FlatData.FlatDataModelProvider.UpdateLevelMembers(IEnumerable`1 items, IHierarchy hierarchy, HierarchyDescriptor hierarchyDescriptor, Int32 levelIndex, DimensionMetadata dimensionMetadata, String uniqueNamePart)

at Infragistics.Olap.FlatData.FlatDataModelProvider.UpdateLevelMembers(IEnumerable`1 items, IHierarchy hierarchy, HierarchyDescriptor hierarchyDescriptor, Int32 levelIndex, DimensionMetadata dimensionMetadata, String uniqueNamePart)

at Infragistics.Olap.FlatData.FlatDataModelProvider.OnRemoveItemsFromItemsSource(ItemsSourceChangedEventArgs eventArgs, IList`1& deletedDataObjects, IList`1& modifiedHierarchies)

at Infragistics.Olap.FlatData.FlatDataModelProvider.OnUpdateHierarchiesData(ItemsSourceChangedEventArgs args)

at Infragistics.Olap.FlatData.FlatDataModelProvider.<>c__DisplayClass11.<ItemsSourceChanged>b__f()

at System.Threading.ThreadHelper.ThreadStart_Context(Object state)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

at System.Threading.ThreadHelper.ThreadStart()

InnerException:

/////////////////////////////////////////////////////////////////////////////////////////////////////////////

In my previous discussion of the problem with Plamen Pilev I understand that exception occurs while Data Source is not fully refreshed yet and (I am citing now from one of Plamen's e-mail) :

"OnRemoveItemsFromItemsSource collects an information about the hierarchies affected by this collection change.

UpdateLevelMembers method goes through the levels of affected hierarchies and remove the members that are no longer present because all data items which this member represents are removed.

This exception is signal that there is no such member in the level – because it’s not created yet I think. That might happen when the processing of the new added to rows/columns hierarchy is not finished yet, so its hierarchy structure (levels and members) is not ready and in the same time we try to remove an element of that structure."

I was advised by Plamen to continue discussion of this problem in the forum as it seems more appropriate from Dev. Support point of view.

Thanks a  lot in advance for the help.

Alex Nebogatov

 

 

 

 

Parents
  • 138253
    Offline posted

    Hello Alex,

     

    I apologize for the late reply. I tested your sample and see what is your issue, but could you built you solution again and set the assemblies specific version to false, so we could test it with our latest builds.

     

    Looking forward for your reply.

  • 605
    posted in reply to Stefan

    Hi Stefan,

    Here is the link for updated solution. http://www.sendspace.com/file/mh19lm

    I did not see though Specific version set to true in my solution.

    Also, the problem I am trying to resolve is now a subject of open ticket

    (Infragistics case CAS-85408-WW5S31 [I]) 

    Thanks a lot,

    Alex

  • 605
    posted in reply to Stefan

    Hi Stephan,

    I've just downloaded and ran my solution from the sendspace link I've specified in previous post and I see same result.

    There is no special steps actually to repro InvalidOperationException in FlatDataSource - You just start up application and wait few second when on timer tick operation of loading data source with test data  from xml file will  takes place. Also please make sure that  you break on any CLR Exceptions

     

     By then you should see the following  in output window in your VS 2010 :

    Step into: Stepping over non-user code 'FlatDataSourceException.App.App'

    Step into: Stepping over non-user code 'FlatDataSourceException.App.InitializeComponent'

    System.Windows.Data Error: 40 : BindingExpression path error: 'x:PivotVm' property not found on 'object' ''PivotControlViewModel' (HashCode=16946857)'. BindingExpression:Path=x:PivotVm; DataItem='PivotControlViewModel' (HashCode=16946857); target element is 'PivotControl' (Name='_pivotControl'); target property is 'DataContext' (type 'Object')

    System.Windows.Data Error: 40 : BindingExpression path error: 'Databases' property not found on 'object' ''FlatDataSource' (HashCode=43171494)'. BindingExpression:Path=DataSource.Databases; DataItem='XamPivotDataSelector' (Name='dataSelector'); target element is 'Dropdown' (Name=''); target property is 'ItemsSource' (type 'IEnumerable')

    System.Windows.Data Error: 40 : BindingExpression path error: 'Database' property not found on 'object' ''FlatDataSource' (HashCode=43171494)'. BindingExpression:Path=DataSource.Database; DataItem='XamPivotDataSelector' (Name='dataSelector'); target element is 'Dropdown' (Name=''); target property is 'SelectedItem' (type 'Object')

    System.Windows.Data Error: 40 : BindingExpression path error: 'NewGridLocation' property not found on 'object' ''PivotControlViewModel' (HashCode=16946857)'. BindingExpression:Path=NewGridLocation; DataItem='PivotControlViewModel' (HashCode=16946857); target element is 'ComboBox' (Name='_locations'); target property is 'ItemsSource' (type 'IEnumerable')

    MainWindow - updateGUI() _stsPositions.SuspendCollectionChangeNotification() executed

    MainWindow - updateGUI() _stsPositions Count - 0

    MainWindow - updateGUI() vm.RefreshPositions() starting

    MainWindow - updateGUI() vm.RefreshPositions() done

    _stsPositions Count - 0

    LoadTestData() finished . _stsPositions Count: 0

    RefreshPositions() _positions.SuspendCollectionChangeNotification() is executed

    RefreshPositions() _positions Count - 0

    1.Added pos #0 to _positions. Count - 1

    1.Added pos #1 to _positions. Count - 2

    1.Added pos #2 to _positions. Count - 3

    1.Added pos #3 to _positions. Count - 4

    RefreshPositions() _positions.ResumeCollectionChangeNotification() is executed

    RefreshPositions() _positions Count - 4

    STSPositionViewModel RefreshPositions(String book) positions.SuspendCollectionChangeNotification(); is executed

    RefreshPositions(String book) _positions Count - 4

    RefreshPositions(String book) _positions.Clear(); is to be executed_positions Count - 4

    RefreshPositions(String book) _positions.Clear(); was executed_positions Count - 0

    RefreshPositions(String book) pos #0 to be yet added to _positions. Count - 0

    RefreshPositions(String book) Added pos #1 to _positions. Count - 1

    RefreshPositions(String book) pos #2 to be yet added to _positions. Count - 1

    RefreshPositions(String book) Added pos #3 to _positions. Count - 2

    RefreshPositions(String book) pos #4 to be yet added to _positions. Count - 2

    RefreshPositions(String book) Added pos #5 to _positions. Count - 3

    RefreshPositions(String book) pos #6 to be yet added to _positions. Count - 3

    RefreshPositions(String book) Added pos #7 to _positions. Count - 4

    STSPositionViewModel RefreshPositions(String book) positions.ResumeCollectionChangeNotification(); is executed

    RefreshPositions(String book) _positions Count - 4

    ***********************************************************

    Plsease don't mention pos# bug. I've just incremented pos index wrongfully in Debug.WiteLine statement on line 174 in STSPositionsViewModel.cs 

     

    Actually I have another suggestion for you guys. Why don't you send me your version of the solution that works Ok on your side. Let me run it on my machine. Please include all dlls that you use. You can upload it to same resource sendspace.com.

    Thanks a lot in advance,

    Alex

Reply Children