VIBlend
Home Products Downloads Purchase Support Forum About Blog

Highly optimized new version of VIBlend WPF DataGrid is almost here

by viblend 18. November 2010 23:44

The main focus of the upcoming major release is on the WPF DataGrid control. There are two main areas that were the target of improvement – performance and business-oriented features. The performance is improved in various scenarios including navigation, scrolling and data binding. You can easily create an excel-like spreadsheet with thousands of rows and columns or bind the DataGrid to large datasets. Some of the key new features will be the built-in Clipboard support, Localization Provider, enhanced Data Layer through binding to a DataTable and improved support for MVVM. 


 

If you have already worked with the VIBlend Silverlight and WinForms DataGrids, you will also benefit from the shared codebase between our DataGrid controls.

Another small improvement will be the new default theme: 



We sincerely hope that you'll like the new changes and we'll be glad to hear your feedback. If you have any questions regarding the new release, please feel free to contact us at support@viblend.com 

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"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="600" d:DesignWidth="800"
    xmlns:viblend="clr-namespace:VIBlend.Silverlight.Controls;assembly=DataGrid">

    <Grid x:Name="LayoutRoot" Background="White">
            <viblend:DataGrid AutoGenerateColumns="True" PivotValuesOnRows="False" Name="dataGrid1"  Height="200" Width="500">
                <viblend:DataGrid.BoundPivotRows>
                    <viblend:BoundField DataField="Country" Text="Country"/>
                    <viblend:BoundField DataField="Region" Text="Region"/>
                    <viblend:BoundField DataField="City" Text="City"/>
                </viblend:DataGrid.BoundPivotRows>
                <viblend:DataGrid.BoundPivotColumns>
                   <viblend:BoundField DataField="ShipperCompany" Text="Shipper Company"/>
                </viblend:DataGrid.BoundPivotColumns>
                <viblend:DataGrid.BoundPivotValues>
                    <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"/>
                </viblend:DataGrid.BoundPivotValues>
            </viblend:DataGrid>
    </Grid>
</UserControl>

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.

Cross-platform OLAP with VIBlend Silverlight Pivot Grid

by viblend 27. November 2009 07:50

In a typical data grid, the data is flat and consists of many rows and columns. The data may contain cells with same values and working with the raw data may not be the best way to spot patterns and analyze trends. Many data grid controls provide rows grouping functionality which allows you to group multiple rows by columns where the corresponding grid cells have the same value.
Pivot tables go one step further and enable powerful data analysis. A Pivot table consists of rows, columns and data (value/fact) fields.
VIBlend DataGrid for Silverlight features a built-in data aggregation engine which is capable of turning any tabular data source into a wide variety of cross tab views. This is similar to the Pivot tables functionality in Excel. Creating a Pivot table with VIBlend DataGrid for Silverlight is very easy. In fact, the data binding to the data source is no different than data binding any other control to a collection. Assume that you have a table with five columns: Country, Region, City, ShipperCompany and ExtendedPrice. You need to choose the columns from the data source and add them to the BoundFields collection:

  CSharp:


pivotGrid1.BoundFields.Add(new BoundField("Country", "Country"));
pivotGrid1.BoundFields.Add(new BoundField("Region", "Region"));
pivotGrid1.BoundFields.Add(new BoundField("City", "City"));
pivotGrid1.BoundFields.Add(new BoundField(
"Shipper Company ", "ShipperCompany"));
pivotGrid1.BoundFields.Add(new BoundField(
"ExtendedPrice", "ExtendedPrice"));


Using this code, once you data bind to the data source, the grid will display all table rows and the five columns: Country, Region, City, Carrier, Extended Price.
However, let’s look at a scenario where we want to show count of sales, amount of sales, and average sale amount grouped by Country, by Region and by City, and do that for each Shipper Company.
This requires only a few extra lines of code:

1. Assign the Country, Region and City fields to form the Rows hierarchy:

CSharp:

pivotGrid1.BoundPivotRows.Add(new BoundField("Country", "Country"));
pivotGrid1.BoundPivotRows.Add(new BoundField("Region", "Region"));
pivotGrid1.BoundPivotRows.Add(new BoundField("City", "City"));


2. Assign the ShipperCompany field to form the Columns hierarchy:

CSharp:

pivotGrid1.BoundPivotColumns.Add(new BoundField(
"Shipper Company", "ShipperCompany"));


3. Assign the ExtendedPrice field to form the facts/values for count of sales, sales amount, and average sale amount:

CSharp:

pivotGrid1.BoundPivotValues.Add(new BoundValueField("Count of Sales", "ExtendedPrice", PivotFieldFunction.Count));
pivotGrid1.BoundPivotValues.Add(new BoundValueField("Amount of Sales", "ExtendedPrice", PivotFieldFunction.Sum));
pivotGrid1.BoundPivotValues.Add(new BoundValueField("Avg Sale Amount", "ExtendedPrice", PivotFieldFunction.Average));


4. Specify if the value/fact columns appear attached to the rows or to the columns:

CSharp:

pivotGrid1.PivotValuesOnRows = false;


During the data binding process, the OLAP engine in VIBlend DataGrid for Silverlight will parse the table content, build the rows and columns hierarchies, and compute the pivot table cell values. The result will be the following pivot table view:


Silverlight Pivot Table



You can learn more and see a Live demo at: http://www.viblend.com

About the author

Some text that describes me

Tag cloud

Recent comments

Comment RSS
Copyright © 2011 VIBlend  
ALL RIGHTS RESERVED  
 
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