I am trying to port my OLAP reports from a previously used tool to an application using your xamPivot controls. I have eventually managed to get by initial problems having had much help from your examples. However there is one vital task that I can not manage to figure out. I need to have an event notifying me when items have been added or removed from filter dimensions. By using your examples I have been able to implement the event fired when dimensions are added/removed from the filter collection (pivotgrid.DataSource.Filters.CollectionChanged), but I need to know when the operator changes visible/hidden elements in each filter.
Hello Jorvart,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Thank you Todor,
you got my requirements right and your code is very probably a part of what I need to get where I want. But I have a bit of problems with finding where to put it,
I would think that I would need to register the eventhandler as described every time a dimension is added to the filter collection, using the pivotGrid.DataSource.Filters.CollectionChanged event. But when this event is fired the pivotGrid.DataSource.Filters[0].FilterMembers will be null.
Regards Jorvart
Hi
If you mean to listen when some check box is checked or unchecked you can use code below:
// get the filter dimensionIFilterViewModel fvm = PivotGrid.DataSource.Filters[0] as IFilterViewModel;// FilterMembers is hierarchycal item for populating the filter treefvm.FilterMembers[0].PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(MainWindow_PropertyChanged);
void MainWindow_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e){ if (e.PropertyName == "IsSelected") { //do something here }}
Regards
Todor