I am using a flatdatasource and would like the xampivotgrid to display changes in the actual data values either on a button click or automatically. So if the data is modified by another control or in the background I want to refresh the values as efficiently as possible.
I cannot find how to do this. The RefreshGrid method does not seem to reflect my data changes so can someone please help?
Regards,Doug Rees
Polo Ralph Lauren
Hello Doug,
FlatDataSource does not track INotifyPropertyChanged events fired by instances of its ItemsSource but it tracks INotifyCollectionChanged of items source and updates its UI automatically.
Another way to enforce that to happen is to set ItemsSource to null and set it back again to your IEnumerable.
Regards.
Plamen.
Hi Plamen,
Ok. I tried this but it errors when I set the ItemsSource to null:
FlatDataSource
List
>;
products[0].NBS *= 10;
fs.ItemsSource =
fs.ItemsSource = products;
The error is:
System.NullReferenceException was unhandled by user code Message=Object reference not set to an instance of an object. StackTrace: at Infragistics.Olap.FlatData.FlatDataConnectionSettings.OnItemsSourceChangedImpl(Object newValue, Object oldValue) at Infragistics.Olap.FlatData.FlatDataConnectionSettings.OnItemsSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue) at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation) at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet) at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value) at Infragistics.Olap.FlatData.FlatDataConnectionSettings.set_ItemsSource(IEnumerable value) at Infragistics.Olap.FlatData.FlatDataSource.set_ItemsSource(IEnumerable value) at BuySheetPrototype1.PivotGridTester.modifydata_Click(Object sender, RoutedEventArgs e) at System.Windows.Controls.Primitives.ButtonBase.OnClick() at System.Windows.Controls.Button.OnClick() at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e) at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName) InnerException:
Sorry, this might be more readable:
FlatDataSource fs = this.pivotGrid.DataSource as FlatDataSource;List<Product> products = fs.ItemsSource as List<Product>;products[0].NBS *= 10;fs.ItemsSource = null;fs.ItemsSource = products;
Can you check which version of binaries you have? I think that with latest service release that wouldn’t cause any errors.
Thanks.
10.2.20102.1029
Well, it looks like a bug. As workaround you have to create a new list with your updated items or create new FlatDataSource. I'll try to fix it for next release.
Best regards and thank you for your feed back.Plamen.
Plamen Pilev"] Well, it looks like a bug. As workaround you have to create a new list with your updated items or create new FlatDataSource. I'll try to fix it for next release. Best regards and thank you for your feed back.Plamen.
Has this bug been fixed and released? I believe this is a bug that I am running into now.
Hi,
This will be fixed in the upcoming SR planned for the next week.Regards.PPilev.
Hello,
Thank you for your feedback. I'll try to reproduce your case and write you back.
Best regards.PPilev.
I am trying to assign the new 11.1 XamPivotGrid Datasource.ItemsSource to a CollectionView which filters an undelying observable collection. Every time the filter changes, my app crashes with the following error:
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at Infragistics.Olap.FlatData.FlatDataSource.OnChangeableDataProviderSourceChanged(DataProviderSourceChangedEventArgs e) at Infragistics.Olap.DataSourceBase.OnChangeableDataProviderSourceChanged(Object sender, DataProviderSourceChangedEventArgs e) at Infragistics.Olap.FlatData.FlatDataModelProvider.OnDataProviderSourceChanged(DataProviderSourceChangedEventArgs args) at Infragistics.Olap.FlatData.FlatDataModelProvider.<>c__DisplayClass1b.<OnUpdateHierarchiesData>b__1a(Object e) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, 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.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.Run() at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.RunInternal(Window window) at System.Windows.Application.Run(Window window) at System.Windows.Application.Run()
This seems similar to the exception on this forum thread. Could you please tell me if there is any special handling required to use the aforementioned fix in 11.1?
Thanks
Where can someone find a list of items that have been fixed in the 11.1 release?
Makes sense... I'm on 10.3 currently. Thanks for the update.