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.
Are there any plans to support INotifyPropertyChanged events in the future? This would be extremely useful for my current application. I am now trying to implement the live updating methods found in the samples browser but I with the cells would update without having to refresh the whole grid display.
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: