Hi,
I have a XamPivotGrid that displays a OlapFlatDataSource.
<igOlap:FlatDataSource x:Key="OlapFlatDataSource" MeasureListLocation="Rows" ConnectionSettings="{StaticResource OlapFlatDataConnectionSettings}" Cube="KategorienZellen" Columns="[Datum].[Datum]" Rows="[Kategorie].[Kategorie]" Measures="Zellen" > <igOlap:FlatDataSource.CubesSettings> <igOlap:CubeMetadata DataTypeFullName="Dispo.KategorienZellen" DisplayName="KategorienZellen" > <igOlap:DimensionMetadata SourcePropertyName="Zellen" DimensionType="Measure" DisplayName="Zellen" /> <igOlap:DimensionMetadata SourcePropertyName="Kategorie" DisplayName="Kategorie" /> </igOlap:CubeMetadata> </igOlap:FlatDataSource.CubesSettings> <igOlap:FlatDataSource.HierarchyDescriptors> <igOlap:HierarchyDescriptor SourcePropertyName="Kategorie" HierarchyName="Kategorie" > <igOlap:HierarchyDescriptor.LevelDescriptors> <igOlap:HierarchyLevelDescriptor LevelName="LogischeGruppe" LevelExpressionPath="Kategorie.LogischeGruppe" LevelDisplayName="LogischeGruppe" /> <igOlap:HierarchyLevelDescriptor LevelName="HauptTyp" LevelExpressionPath="Kategorie.HauptTyp" LevelDisplayName="HauptTyp" /> <igOlap:HierarchyLevelDescriptor LevelName="Typ" LevelExpressionPath="Kategorie.Typ" LevelDisplayName="Typ" /> </igOlap:HierarchyDescriptor.LevelDescriptors> </igOlap:HierarchyDescriptor> <igOlap:HierarchyDescriptor SourcePropertyName="Datum" HierarchyName="Datum" HierarchyDisplayName="Datum" > <igOlap:HierarchyDescriptor.LevelDescriptors> <igOlap:HierarchyLevelDescriptor LevelName="Woche"/> <igOlap:HierarchyLevelDescriptor LevelName="Tage" LevelExpressionPath="Datum" DisplayFormat="{}dddd" LevelDisplayName="Tage"/> </igOlap:HierarchyDescriptor.LevelDescriptors> </igOlap:HierarchyDescriptor> </igOlap:FlatDataSource.HierarchyDescriptors> </igOlap:FlatDataSource>
<ig:XamPivotGrid Grid.Row="2" x:Name="pivotGrid" DataSource="{StaticResource OlapFlatDataSource}" ColumnSorting="pivotGrid_ColumnSorting" > <igCharts:XamPivotGrid.SortingSettings> <igCharts:PivotSortingSettings AllowSorting="True" ShowSortIndicator="True" /> </igCharts:XamPivotGrid.SortingSettings> </ig:XamPivotGrid>
The XamPivotGrid displays the Data and shows the sortindicators but nothing happens if i click them.
I just want the Measures to be able to sort and in code behind
this.pivotGrid.SelectionSettings.CellSelectionAction = PivotCellSelectionAction.SelectCell; this.pivotGrid.SelectedCellsCollectionChanged += (sender, e) => { PivotDataColumn dataCol = (e.NewSelectedItems.First().Column as PivotDataColumn); dataCol.IsSorted = PivotSortDirection.Ascending; };
I'm able to do it.
I dont get what I'm missing.
Wrong: Expected:
Hello Michael,I'm also using the version 18.1. In the samples everything works fine, but not in my code.This is the way I create my data:
public class Kategorie { public string Typ { get; set; } public string HauptTyp { get; set; } public string LogischeGruppe { get; set; } } public class KategorienZellen { public int Zellen { get; set; } public Kategorie Kategorie { get; set; } public DateTime Datum { get; set; } } public class ProduktTypDataProvider { clsDaten Daten = new clsDaten(); public ProduktTypDataProvider() { this.Data = new ObservableCollection<KategorienZellen>(GenerateData()); } public ObservableCollection<KategorienZellen> Data { get; set; } public IEnumerable<KategorienZellen> GenerateData() { DataTable dtDaten = Daten.Gib_Diagramm_ZellenverteilungTageHierarchical(DateTime.Today); List<KategorienZellen> kategorienZellen = new List<KategorienZellen>(); foreach (DataRow dr in dtDaten.Rows) { KategorienZellen KategorieZelle = new KategorienZellen { Zellen = (int)dr["Zellen"], Datum = (DateTime)dr["Datum"], Kategorie = new Kategorie { Typ = dr["ProduktTyp"].ToString(), HauptTyp = dr["HauptTyp"].ToString(), LogischeGruppe = dr["LogischeGruppe"].ToString() } }; kategorienZellen.Add(KategorieZelle); } return kategorienZellen; }
Maybe I do something wrong there?
Hello Benedikt,
Thank you for following up. I can't tell from your snippet above why the issue would be occurring. Is it possible for you to send me a complete sample I can debug? Otherwise I will spend time today putting a sample together.
Let me know if you have any questions.
i Michael,
I have added a Project with only the problematic part.
You wont be able to connect to my sql-database, so I added a excel-file withe the data my query there returns.
Maybe you can recreate it with that.
www.dropbox.com/.../Sort.zip