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

Parents
No Data
Reply
  • 3160
    posted

    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.

Children