Blogs

Gary's Blog

XAF – Pivot Grid & Chart List Editors (coming in V2010 Vol 2)

     

Data comes in all shapes and sizes and businesses want to look at it from all the different angles. Luckily DevExpress has a number of different components to help you do just that. Previously, I examined the difference between grouping versus pivoting with our grids. To make things even easier for you, in V2010 Vol 2 XAF will introduce two new ListEditors, they are: Chart and PivotGrid.

Previously, to show data in a PivotGrid, you had to create an Analysis module. Well not anymore! As of V2010.2 it will be possible to show any collection in a PivotGrid or Chart by changing the editor for a ListView and  customizing it, if needed.

Let's create a view that will show us a collection of Order objects in a PivotGrid. We'll use the FeatureCenter application as an example.

Open the ModelEditor and navigate to the Order_ListView view. Select WinPivotGridListEditor in the EditorType dropdown:

PivotChart_01

Select the PivotSettings node, and open the wizard by clicking on the ellipsis button for Settings attribute:

 PivotChart_02
The PivotGrid designer is opened. Using this designer, we are able to completely customize the PivotGrid. Let's create PivotGrid fields for the necessary properties by double clicking on a property name in the Field List. First, let’s add a Freight field:

 PivotChart_03
We also need three more fields that are not listed in the Field List: Employee.FullName, Customer.Country, Customer.City  and Customer.CompanyName. Let's create them manually, by clicking the Add button, and selecting FieldName:

 PivotChart_04
Now we can layout the grid. Navigate to the layout and move the Freight field to the data area, Employee field to the Column area and Customer.Country, Customer.City  and Customer.CompanyName to the RowArea:

 PivotChart_05
Let's return to the Fields section and correct the captions to avoid dots in field names:

 PivotChart_06
We can now close the wizard and save the model. Note that the Settings attribute contains the entire configuration we created, stored in XML format:

 PivotChart_07
The FeatureCenter does not show this Orders view in the navigation by default, so let's add the corresponding navigation item:

 PivotChart_08
Now we can see the view in action. Save the model and run the application. This is what our orders view looks like in the PivotGrid:

PivotChart_09

And sales in the as a chart:

PivotChart_10

And of course, this all works in ASP.Net XAF applications too:

PivotChart_11

PivotChart_12

That’s all for this post, until next time, happy XAFing! :-)

Published Aug 12 2010, 01:58 PM by Gary Short (DevExpress)
Filed under: ,
Technorati tags: v2010.2, XAF
Bookmark and Share

Comments

 

Gerhard Achrainer said:

Hi,

this looks VERY promising. I hope you also have a way to localize the Names of the Pivot's Columns?

August 12, 2010 5:20 PM
 

yang tong said:

Great!!!

August 12, 2010 10:42 PM
 

Julien Ferraro said:

Yeaaaaahhh

You know what was my thought (the one just after the Yeaaahhh) : We need this for the XtraGrid. The ability to open the grid designer and completely customize it at design time !!!

Hope DevEx is listening ... sorry, I know you are !

August 12, 2010 11:48 PM
 

Steve Sharkey said:

So if these are for the list view is it possible to "click thru" to underlying data?

August 13, 2010 2:31 AM
 

Dennis (DevExpress Support) said:

Hi Steve,

We appreciate your feedback.

Currently, it's impossible out-of-the-box, but I have logged a corresponding suggestion in our database: www.devexpress.com/issue=S35505

I guess that you would like to have the capability to select cells in the pivot grid or click on the chart, and then display a popup ListView with the underlying objects, right?

August 18, 2010 12:00 PM
 

Dennis (DevExpress Support) said:

@Julien:

We have a corresponding suggestion in this regard: www.devexpress.com/issue=AS12649

but I am afraid that we don't have upcoming plans to implement this. I agree that designers are often good, and they provide a lot of flexibility to customize a control as required, but at the same time it's also easy to break the default functionality with such unrestricted customizations. Anyway, we will see how to better address both problems. For example, I have recently heard that eXpand (a third-party framework based on XAF - apobekiaris.blogspot.com) provides a similar functionality:

apobekiaris.blogspot.com2010/08/contolling-devexpress-xtragrid-part-2.html

apobekiaris.blogspot.com2010/04/controlling-devexpress-aspxgridcontrol.html

August 18, 2010 12:21 PM
 

Dennis (DevExpress Support) said:

@Gerhard:

Thanks for your feedback. We will try to make it possible to read localized values for pivot grid columns from the application model in the release (I have just registered a bug report in this regard).

August 18, 2010 12:35 PM
More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.