Version

Super-Compact Layout (xamPivotGrid)

Topic Overview

Purpose

This topic introduces the Super-Compact layout feature of the xamPivotGrid™ and explains, with code examples, how to configure it.

Required background

The following topics are prerequisites to understanding this topic:

Topic Purpose

This topic is an introduction to the xamPivotGrid control’s key features and functionalities.

This topic demonstrates how to get started with the xamPivotGrid control by providing step-by-step procedure for adding this control to a WPF application.

Introduction

Super-Compact layout summary

The Super-Compact layout of the pivot grid is an alternative layout of the xamPivotGrid control designed for saving horizontal space. Instead of showing each child level of the row hierarchy in header cells placed on the right of their parent header cell (as with the Standard layout), the child-level header cells are placed either beneath or above it. In order to differentiate different levels of the hierarchy, each of them outset to the right by a specified distance.

The Compact layout is another option similar to the Super-Compact layout. It also displays row header cells as nodes to minimize the horizontal space that they occupy, leaving just the expand/collapse toggles in front of child-cells. With the Compact layout however you have no control over the indentation of child-cells as you have with the Super-Compact layout. So the Super-Compact layout provides you with more options when saving horizontal space is essential and additionally allows you to visually emphasize on the tree-like structure of the row hierarchies.

Standard layout
xamPivotGrid Super Compact Layout 01.png

Compact Layout (children above parents)

xamPivotGrid Super Compact Layout 02.png

Super-Compact Layout (children beneath parents)

xamPivotGrid Super Compact Layout 03.png

By default, the xamPivotGrid is instantiated with its Normal layout so you need to explicitly enable the Super-Compact layout if you want to use it.

Like with all layouts, you can specify whether parent nodes to be displayed above or beneath their child nodes and set the horizontal indent for the levels.

Enabling the Super-Compact Layout

Overview

Enabling the Super-Compact layout is done by setting the AllowSuperCompactLayout property of the xamPivotGrid to True . Additional configurations can be done as explained in Super-Compact Layout Configuration Summary.

Super-Compact Layout Configuration Summary

Super-Compact layout configuration summary chart

The following table lists the configurable aspects of the xamPivotGrid control regarding the super-compact layout.

Configurable aspect Details Properties

The indent of the child-header cells

The indentation of the row header cells in a level is configurable.

Parent node placement

Parent cells can be displayed above or beneath their children.

Other related properties:

Note
Note:

Setting AllowSuperCompactLayout to True will set the AllowCompactLayout (enabling the Compact layout ) to False and, if the Compact layout has been used prior to setting this property to True, the Compact layout will be disabled.

Property settings

The following table maps the desired configuration to property settings.

In order to: Use this property: And set it to:

Enable the Super-Compact layout

True

Set the indent for child levels

An integer number of your choice. (Negative numbers are treated as 0 .)

Show parents above of children

True

Example – parent above children

The screenshot below demonstrates how the xamPivotGrid looks as a result of the following settings:

xamPivotGrid Super Compact Layout 04.png

Example – parent beneath children

The screenshot below demonstrates how the xamPivotGrid looks as a result of the following settings:

xamPivotGrid Super Compact Layout 05.png

Code Example: Super-Compact Layout with Parents Above Children and 30 Pixels Identation

Description

The code example below demonstrates how to enable the Super-Compact layout feature of the xamPivotGrid and configure it to display parent row header cells above their children with an indentation of 30 pixels.

Code

In XAML:

Code
<ig:XamPivotGrid x:Name="pivotGrid"
                         DataSource="{StaticResource DataSource}"
                         AllowSuperCompactLayout="True"
                         SuperCompactLayoutIndent="30"
                         ParentInFrontForColumns="
                         ParentInFrontForRows="True"/>

Related Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic explains the Compact Layout feature of the xamPivotGrid .

This topic explains how to create custom templates for data and header cells of the xamPivotGrid .

This topic explains how to do conditional (value-based) formatting in the xamPivotGrid control and provides a code example.

This topic explains how to allow the user to change the width of the columns of the xamPivotGrid and how to customize the resizing behavior