Version

Styling WinPivotGrid

Topic Overview

Purpose

This topic illustrates, with screenshots, the available options and configurations in customizing the appearance of the WinPivotGrid™ control.

Styling WinPivotGrid

Introduction

There are several ways to style the appearances of the WinPivotGrid control’s visual elements. The appearance of each element can be changed using the control’s appearance property. The WinPivotGrid also supports AppStylist, used to create a style library file with desired styles for each of the elements and save it as a theme file for your pivot grid. AppStylist also comes with existing library files. Use these to model from and customize the WinPivotGrid .

Styling the elements

Elements such as rows, columns, cells, drop areas, and control have appearance properties that can be customized as demonstrated in the following code:

In C#:

ultraPivotGrid1.RowHeaderAppearance.Normal.BackColor = Color.LightSkyBlue;
ultraPivotGrid1.ColumnHeaderAppearance.Normal.BackColor = Color.LightSeaGreen;
ultraPivotGrid1.CellAppearance.Normal.BackColor = Color.LightGray;
ultraPivotGrid1.CellAppearance.Normal.BorderColor = Color.DarkSlateBlue;
ultraPivotGrid1.Appearance.BackColor = Color.LightSteelBlue;
ultraPivotGrid1.FilterDropArea.Appearance.Normal.BackColor = Color.MediumOrchid;

In Visual Basic:

ultraPivotGrid1.RowHeaderAppearance.Normal.BackColor = Color.LightSkyBlue
ultraPivotGrid1.ColumnHeaderAppearance.Normal.BackColor = Color.LightSeaGreen
ultraPivotGrid1.CellAppearance.Normal.BackColor = Color.LightGray
ultraPivotGrid1.CellAppearance.Normal.BorderColor = Color.DarkSlateBlue
ultraPivotGrid1.Appearance.BackColor = Color.LightSteelBlue
ultraPivotGrid1.FilterDropArea.Appearance.Normal.BackColor = Color.MediumOrchid

The result.

Styling WinPivotGrid 1.png

Using AppStylist

Using AppStylist at runtime

AppStylist at runtime requires adding the AppStylistRuntime control on to the form and calling a method, in code, to start up the AppStylist when the application starts running. The following two steps demonstrates this:

  1. Drop the AppStylistRuntime control on to the form.

Styling WinPivotGrid 2.png
  1. Use the following code to start up the AppStylist.

In C#:

appStylistRuntime1.ShowRuntimeApplicationStylingEditor(this, "AppStylist");

In Visual Basic:

appStylistRuntime1.ShowRuntimeApplicationStylingEditor(Me, "AppStylist")

The following screenshot illustrates AppStylist at runtime customizing the pivot grid row drop area.

For more details on how to style your application with AppStylist please refer to the Setting Up Your Application for Styling topic.

Styling WinPivotGrid 3.png

Using AppStylist library

Using AppStylist library file is a convenient way of styling the control. The style library file can be created and saved, and can be added in any application that uses WinPivotGrid . After creating an AppStylist library file, add it to your application and use the following code to load it.

In C#:

Infragistics.Win.AppStyling.StyleManager.Load("..\\PivotGridStyleSet.isl");

In Visual Basic:

Infragistics.Win.AppStyling.StyleManager.Load("..\PivotGridStyleSet.isl")

The final result.

Styling WinPivotGrid 4.png

Related Content

Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic explains and demonstrates the WinPivotGrid data binding to each supported data Source/Provider.

This section lists common terms used in pivot grid topics.