Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3160
Dynamically display measures?
posted

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();
}