$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
Windows Forms PivotGrid Control
Create interactive user interface of Pivot table, build summarizations and highlight specific data
Home > WinForms UI Controls > User Manual > PivotGrid Data Source Property in C#

Populate PivotGrid with Data using DataSource Property in C#.NET

KetticPivotGrid WinForms control has the same feature as any other data control for Windows Forms. It allows the users to populate this control to a data source by using a DataSource property of the KetticPivotGrid control. To bind PivotGrid to an existing data source, we can customize the properties of PivotGrid control, DataSource property and DataMember property. This article will demonstrate how to populate PivotGrid with data by using DataSource property in C#.NET template projects.

C# for Binding PivotGrid to Data with DataSource Property

The C# code below shows the process of populating PivotGrid control with data by setting the DataSource property and DataMember property of the control. In addition, we shall add the desired descriptions to define the data structure being shown.

DateTimeGroupDescription() { PropertyName = "OrderDate", Step =
DateTimeStep.Year, GroupComparer = new GroupNameComparer() });

DateTimeGroupDescription() { PropertyName = "OrderDate", Step =
DateTimeStep.Month, GroupComparer = new GroupNameComparer() });

PropertyGroupDescription() { PropertyName = "CustomerID", GroupComparer = new
GrandTotalComparer() });

PropertyAggregateDescription() { PropertyName = "Freight", AggregateFunction
= AggregateFunctions.Sum });

PropertyAggregateDescription() { PropertyName = "Freight", AggregateFunction
= AggregateFunctions.Average });

this.ketticPivotGrid1.FilterDescriptions.Add(new PropertyFilterDescription()
{ PropertyName = "CustomerCity", CustomName = "City" });

NwindDataSet dataset = new NwindDataSet();
SamplesCS.DataSources.NwindDataSetTableAdapters.OrdersTableAdapter adapter =
new SamplesCS.DataSources.NwindDataSetTableAdapters.OrdersTableAdapter();

this.ketticPivotGrid1.DataSource = dataset;
this.ketticPivotGrid1.DataMember = "Orders";
UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls