I have very basic case, where I have a collection of a custom object with a bunch of properties that I want to pivot:
public MyStuff{
public string Row1 { get; set;}public string Row2 { get; set;}public string Col1 { get; set;}public string Co2 { get; set;}public int Metric1 { get; set;}public int Metric2 { get; set;}
}
ObservableCollection MyStuff { get; set;}FlatDataSource DataSource { get; set;}Init(){ MyStuff = GetStuff(); DataSource = new FlatDataSource(); DataSource.ItemsSource = MyStuff;
MaxWidth="300" DockPanel.Dock="Left" DataSource="{Binding DataSource}" /> AllowCompactLayout="True" DataSource="{Binding DataSource}">
On the screen, I can drag/drop my objects properties from the data selector on the pivot grid, and everything is fine, EXCEPT, I don't see the totals rolls, and I can't collapse/expand.
In the examples provided, this seems to work fine without anything special. Do I need to do anything special to have the totals rows/columns show up and be able to expand/collapse the hierarchies?
*Edited: Fixed typo in binding
Hello,
Since you're using hierarchy descriptor you need to add such root level explicitly because it's just like all other levels in the hierarchy and it's under your control how this hierarchy will look like. I'm glad you've resolved your issue and I believe that other community members may benefit from this as well. If you have any other questions let us know.Have a great weekend,Plamen
Hi Plamen,
Thanks, that's a typo on my end, binding isn't an issue. I think I figured out the issue. When I specified a Hierarchy Descriptor for the rows that I care about, I added an additional level for the "All" scenario, and that created the totals column. Didn't realize that was necessary. Is there a reason why this isn't inferred by default?
I'm not sure about your application's code but the snippet you've provided seems incomplete and in XAML you have set binding to property named FlatDataSource, whereas in your model I see property named DataSource. Could you please provide the complete code you have?
Thanks,Plamen