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
Pivot grid crashes if hierarchy and level have the same name
posted

Please see FlatDataExample.xaml.cs in the attached project.

Note this section:

     // Crashes here if hierarchies and levels have the same name.
            // However, changing names causes hierarchies not to display in pivot grid.

            PeopleGrid.DataSource.Filters.Add(PeopleGrid.DataSource.CreateFilterViewModel(
                PeopleGrid.DataSource.Cube.Dimensions["Gender"].Hierarchies.First()));

            PeopleGrid.DataSource.Filters.Add(PeopleGrid.DataSource.CreateFilterViewModel(
                PeopleGrid.DataSource.Cube.Dimensions["TypeCode"].Hierarchies.First()));
    
I've tried changing the hierarchy and level names however when I do that the pivot grid does not display any dimenions.
The code below is a WORKING page from a different project that is running the same version of Infragistics (I checked each dll).
Why does it work?

 <igFlatData:FlatDataSource x:Key="RollBookDataSource" x:Shared="False"
                                   Rows="[PIMCO_DESC].[Product],[BROKER].[Broker]"
                                   Columns="[Measure].[Measure]"
                                   Measures="Long,Short,Net">
            <igFlatData:FlatDataSource.ConnectionSettings>
                <igFlatData:FlatDataConnectionSettings ItemsSource="{Binding}"/>
            </igFlatData:FlatDataSource.ConnectionSettings>
            <igFlatData:FlatDataSource.CubesSettings>
                <igFlatData:CubeMetadata DataTypeFullName="Poolman.Models.TBARollPivotItem">
                    <igFlatData:DimensionMetadata SourcePropertyName="Long"
                                                  DisplayFormat="{}{0:#,#;(#,#)}"/>
                    <igFlatData:DimensionMetadata SourcePropertyName="Short"
                                                  DisplayFormat="{}{0:#,#;(#,#)}"/>
                    <igFlatData:DimensionMetadata SourcePropertyName="Net"
                                                  DisplayFormat="{}{0:#,#;(#,#)}"/>
                </igFlatData:CubeMetadata>
            </igFlatData:FlatDataSource.CubesSettings>
            <igFlatData:FlatDataSource.HierarchyDescriptors>
                <igFlatData:HierarchyDescriptor SourcePropertyName="{x:Static local:TBARollBook.kMeasure}">
                    <igFlatData:HierarchyDescriptor.LevelDescriptors>
                        <igFlatData:HierarchyLevelDescriptor LevelName="Type"
                                                             LevelExpressionPath="Measure.Type"/>
                    </igFlatData:HierarchyDescriptor.LevelDescriptors>
                </igFlatData:HierarchyDescriptor>
                <igFlatData:HierarchyDescriptor SourcePropertyName="PM_NAME"
                                                HierarchyName="{x:Static local:TBARollBook.kFilterPM}">
                    <igFlatData:HierarchyDescriptor.LevelDescriptors>
                        <igFlatData:HierarchyLevelDescriptor LevelName="All"/>
                        <igFlatData:HierarchyLevelDescriptor LevelName="PM"
                                                             LevelExpressionPath="PM_NAME"/>
                    </igFlatData:HierarchyDescriptor.LevelDescriptors>
                </igFlatData:HierarchyDescriptor>
                <igFlatData:HierarchyDescriptor SourcePropertyName="DELIVERY_DT"
                                                HierarchyName="{x:Static local:TBARollBook.kFilterDelivery}">
                    <igFlatData:HierarchyDescriptor.LevelDescriptors>
                        <igFlatData:HierarchyLevelDescriptor LevelName="All"/>
                        <igFlatData:HierarchyLevelDescriptor LevelName="Delivery"
                                                             LevelExpressionPath="DELIVERY_DT"/>
                    </igFlatData:HierarchyDescriptor.LevelDescriptors>
                </igFlatData:HierarchyDescriptor>
                <igFlatData:HierarchyDescriptor SourcePropertyName="ROLL_IND"
                                                HierarchyName="{x:Static local:TBARollBook.kFilterRoll}">
                    <igFlatData:HierarchyDescriptor.LevelDescriptors>
                        <igFlatData:HierarchyLevelDescriptor LevelName="Roll"
                                                             LevelExpressionPath="ROLL_IND"/>
                    </igFlatData:HierarchyDescriptor.LevelDescriptors>
                </igFlatData:HierarchyDescriptor>
                <igFlatData:HierarchyDescriptor SourcePropertyName="TURN_IND"
                                                HierarchyName="{x:Static local:TBARollBook.kFilterTurn}">
                    <igFlatData:HierarchyDescriptor.LevelDescriptors>
                        <igFlatData:HierarchyLevelDescriptor LevelName="Turn"
                                                             LevelExpressionPath="TURN_IND"/>
                    </igFlatData:HierarchyDescriptor.LevelDescriptors>
                </igFlatData:HierarchyDescriptor>
                <igFlatData:HierarchyDescriptor SourcePropertyName="PIMCO_DESC"
                                                HierarchyName="{x:Static local:TBARollBook.kViewProduct}">
                    <igFlatData:HierarchyDescriptor.LevelDescriptors>
                        <igFlatData:HierarchyLevelDescriptor LevelName="All"/>
                        <igFlatData:HierarchyLevelDescriptor LevelName="Product"
                                                             LevelExpressionPath="PIMCO_DESC"/>
                    </igFlatData:HierarchyDescriptor.LevelDescriptors>
                </igFlatData:HierarchyDescriptor>
                <igFlatData:HierarchyDescriptor SourcePropertyName="BROKER"
                                                HierarchyName="{x:Static local:TBARollBook.kViewBroker}">
                    <igFlatData:HierarchyDescriptor.LevelDescriptors>
                        <igFlatData:HierarchyLevelDescriptor LevelName="All"/>
                        <igFlatData:HierarchyLevelDescriptor LevelName="Broker"
                                                             LevelExpressionPath="BROKER"/>
                    </igFlatData:HierarchyDescriptor.LevelDescriptors>
                </igFlatData:HierarchyDescriptor>
            </igFlatData:FlatDataSource.HierarchyDescriptors>
        </igFlatData:FlatDataSource>
  
  
  
   RollGrid.DataSource.Filters.Add(RollGrid.DataSource.CreateFilterViewModel(
                RollGrid.DataSource.Cube.Dimensions["PM_NAME"].Hierarchies.First()));
            FilterPM();

            RollGrid.DataSource.Filters.Add(RollGrid.DataSource.CreateFilterViewModel(
                RollGrid.DataSource.Cube.Dimensions["DELIVERY_DT"].Hierarchies.First()));
            FilterDelivery();

            RollGrid.DataSource.Filters.Add(RollGrid.DataSource.CreateFilterViewModel(
                RollGrid.DataSource.Cube.Dimensions["TURN_IND"].Hierarchies.First()));
            FilterTurn();

            RollGrid.DataSource.Filters.Add(RollGrid.DataSource.CreateFilterViewModel(
                RollGrid.DataSource.Cube.Dimensions["ROLL_IND"].Hierarchies.First()));
            FilterRoll();

PivotGridTest.zip