Home Products Downloads Purchase Support Forum About Blog

Creating a Pivot Table in Silverlight using XAML

by viblend 13. January 2010 17:21

New in version 1.4 of VIBlend Silverlight Controls is the ability to create a Pivot Table entirely in XAML.

As usual you have to specify which columns (data fields) from the data source will represent the pivot table's rows, columns and values fields.

Below is the full XAML required to declare a pivot table:

<UserControl x:Class="SilverlightApplication1.MainPage"
    d:DesignHeight="600" d:DesignWidth="800"

    <Grid x:Name="LayoutRoot" Background="White">
            <viblend:DataGrid AutoGenerateColumns="True" PivotValuesOnRows="False" Name="dataGrid1"  Height="200" Width="500">
                    <viblend:BoundField DataField="Country" Text="Country"/>
                    <viblend:BoundField DataField="Region" Text="Region"/>
                    <viblend:BoundField DataField="City" Text="City"/>
                   <viblend:BoundField DataField="ShipperCompany" Text="Shipper Company"/>
                    <viblend:BoundValueField DataField="ExtendedPrice" Text="Count of Sales" Function="Count"/>
                    <viblend:BoundValueField DataField="ExtendedPrice" Text="Amount of Sales" Function="Sum"/>
                    <viblend:BoundValueField DataField="ExtendedPrice" Text="Avg Sale Amount" Function="Average"/>

After that simply bind to the data source by setting the ItemsSource property of the data grid control:

dataGrid1.ItemsSource = myData;

The result is a great looking pivot table with interactive drill down support.

VIBlend DataGrid for Silverlight uses a built-in OLAP engine to construct the pivot table. You can bind the DataGrid to any data source and easily build in-house Business Intelligence and reporting tools within minutes.

Comments are closed

About the author

Some text that describes me

Tag cloud

Recent comments

Comment RSS
Copyright © 2011 VIBlend  
Terms of Use | Privacy Policy
WinForms Controls Purchase Online About Us
DataGrid Navigation Pane Technical Support Blog
ScrollBar TreeView
ListBox ProgressBar Downloads Register
ComboBox Buttons
TabControl Editors Documentation Client Login

VIBlend Blog is powered by BlogEngine.NET