)
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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to create a Pivot Grid with SQL DataSource in WPF

Platform: WPF |
Control: PivotGridControl |
Published Date: November 26, 2014 |
Last Revised Date: November 26, 2014
Tags: general, wpf

We don’t have a PivotGrid control under Web Forms. We have the PivotGrid control under WPF and Silverlight Platforms. We can bind the SQL database file data as the DataTable to the PivotGrid

Please find the steps to have our PivotGrid bind with the data from the SQL Database file.

   1) - Create the sdf file with the datas stored in it (in the provided sample DataBase1.sdf) and add it to the WPF application.

   2) - Drag and drop our PivotGrid control from the toolbox to the MainPage.XAML.

  3) - Then, write a method and use the SqlCeConnection to make the connection with the database, SqlCeCommand to get the columns from the sql Table and SqlCeDataAdapter which is used to execute the command and returns the datas from the sdf file as the DataTable as shown in the below code (we have this under OrderDetails.cs file)

 

 

C#

 

Now, bind this DataTable to the PivotGrid using ItemSource property in PivotGrid with the below code.

 

C#

 

D:\documentation\WPF Sample\PivotGrid.PNG

 

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment
Comments
Hemalatha Marikumar [Syncfusion]
Mar 19, 2020

Could you please provide us with a complete sample?

Reply

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon