We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Pivot Grid Control Features

I am looking for a Windows Forms Pivot Grid Control to analyze data. I am trying to test out the Syncfusion control but have some trouble even finding out how to add the Pivot Field List or some sort of schema designer.

How do I add this? It's not in the toolbox.

Also how do I set a LINQ query result as the data source for the grid?

And does the grid support saving/loading of layouts?

1 Reply

NK Neelakandan Kannan Syncfusion Team October 7, 2014 10:23 AM UTC

Hi Miller,

 

Thank you for your interest in Syncfusion products.

 

Query-1

how to add the Pivot Field List or some sort of schema designer?

If you want to show the Pivot Field List in the Pivot grid control, you can enable the ShowPivotTableFieldList as True.

 

Please refer the below code:

this.pivotGridControl1.ShowPivotTableFieldList = true;

 

Please refer the below UG link:

http://help.syncfusion.com/ug/windows%20forms/default.htm#!documents/addingthepivotschema.htm

 

Query-2

How do I add this?

Query-3

how do I set a LINQ query result?

You can set pivotGrid datasource from SQL query by converting Sql database to data table. so that we can easily assign the data source to the pivot grid. we have to use the System.Data.SqlServerCe.dll assembly to run this sample. We have also attached the dll in the below sample link. We have used a sample database file named “NorthWind.sdf”.

 

Please refer the below code:

this.pivotGridControl1.PivotRows.Add(new PivotItem { FieldMappingName = "City", TotalHeader = "Total" });

 

this.pivotGridControl1.PivotRows.Add(new PivotItem { FieldMappingName = "Last Name", TotalHeader = "Total" });

 

// Adding PivotColumns to the Control

 

this.pivotGridControl1.PivotColumns.Add(new PivotItem { FieldMappingName = "Country", TotalHeader = "Total" });

 

// Adding PivotCalculations to the Control

 

this.pivotGridControl1.PivotCalculations.Add(new PivotComputationInfo { FieldName = "Extension", Format = "C", SummaryType = SummaryType.DoubleTotalSum });

 

}

 

public DataTable GetsData()

{

SqlCeConnection con = new SqlCeConnection("Data Source = SQLCeDB\\Northwind.sdf; Password = Hebot15v");

con.Open();

SqlCeDataAdapter adp = new SqlCeDataAdapter("SELECT \n\t[Employees].[Employee ID]\n\t,[Employees].[Last Name]\n\t,[Employees].[First Name]\n\t,[Employees].[Title]\n\t,[Employees].[Birth Date]\n\t,[Employees].[Hire Date]\n\t,[Employees].[Address]\n\t,[Employees].[City]\n\t,[Employees].[Region]\n\t,[Employees].[Postal Code]\n\t,[Employees].[Country]\n\t,[Employees].[Home Phone]\n\t,[Employees].[Extension]\n\t,[Employees].[Photo]\n\t,[Employees].[Notes]\n\t,[Employees].[Reports To]\n FROM \n\t[Employees]", con);

DataTable dt = new DataTable();

adp.Fill(dt);

return dt;

}

 

Please refer the below sample:

http://www.syncfusion.com/downloads/support/directtrac/130461/Pivot_Grid_Customization697941168.zip

 

Query-4

Does the grid support saving/loading of layouts?

Currently, we don’t have support for saving the layout of pivot grid. We have filed a separate feature report for this task. This feature will be implemented in any of our upcoming releases. If you want further information about this, Please create a DT incident for your query so that we can update the feature related information.

 

You can create the DT incident from the following link.

http://www.syncfusion.com/account/dashboard

 

 

Please let me know if you have any concerns.

 

Regards,

Neelakandan


Loader.
Live Chat Icon For mobile
Up arrow icon