Hi,
I am making changes to the underlying FlatDataSource of my XamPivotGrid and these changes are showing up nicely in the PivotGrid. However, I would like to handle a "valuechanged" event on the cells so that I can momentarily change the background colour of the cell to notify the user of the change.
I have tried to find an appropriate event to handle for this, but couldnt find anything on the PivotCellControl or the PivotCell.
Please could someone let me know where to look?
Thanks in advance.
Phil
Hello Phil,
Thank you for your post!
To start, I can tell you that there isn't any type of event on the XamPivotGrid or the PivotCell / PivotCellControl that can detect the value in the cell changing, unless you are actually doing so by editing the cells in the UI of the grid. From the sounds of it though, you are editing the data of your FlatDataSource in code, and so to get the changes to show up, I am under the impression that you are refreshing the XamPivotGrid after each modification is made. Please let me know if these impressions are incorrect.
I had thought to recommend an implicit style for PivotCellControl that binds the Background property to the PivotCellControl's Cell.Data.Value property, so that when that value changes you would be able to utilize a converter to return the desired background color. The issue with this is that this converter will fire for every cell as it appears in the grid, and you will have no reference to the previous value in the cell, so you wouldn't be able to tell if that value has changed or not. Moreover, this converter will fire for each cell in the grid when you refresh the grid as well, because all of the PivotCellControls become new instances. You need to refresh the grid to show the new values, though.
I would recommend that if you would like to see this functionality built in to the XamPivotGrid, that you submit a new product idea for it at http://ideas.infragistics.com. This site puts you in touch with our product management teams who plan and prioritize new products and features based on user input and feedback.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Hi Andrew,
I'm making changes to the FlatDataSource by changing the items in ItemsSource (ObservableCollection) and also by updating the properties on the underlying business objects.
When I do the former the changes automatically get displayed, and when I do the latter, I am calling FlatDataSource.RefreshGrid.
Either way, from what you've explained I shall need to raise this as a new product idea.
Thanks,