I have a xampivot grid with two measures. I want to display only one measure at a time. I have a radio button control that allows the user to select which measure to display. I tried to follow the example given here but I cant make it work: http://community.infragistics.com/forums/p/58903/299527.aspx#299527
Here is the click event handler of my radio button:
private void OnViewChanged(object sender, RoutedEventArgs e){
FilterHelper.FlatDataSource.CubesSettings.Clear(); CubeMetadata cubeMetaData = new CubeMetadata(); cubeMetaData.DataTypeFullName = FilterHelper.FlatDataSource.ItemsSource.AsQueryable().ElementType.FullName; cubeMetaData.DimensionSettings.Add(new DimensionMetadata {SourcePropertyName="Qty", AutoGenerateField=ViewModel.IsQuantityView, DimensionType=DimensionType.Measure }); cubeMetaData.DimensionSettings.Add(new DimensionMetadata { SourcePropertyName = "PctMktValue", AutoGenerateField = !ViewModel.IsQuantityView, DimensionType = DimensionType.Measure }); FilterHelper.FlatDataSource.CubesSettings.Add(cubeMetaData); FilterHelper.FlatDataSource.RefreshGrid();}
Answered here:
http://community.infragistics.com/forums/t/69498.aspx
I've managed to work around this problem for the moment by simply defining two flatdatasources, one for qty and another for percent of toal. This is not clean however, I would like to define just one and change the measure property as needed.