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.
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

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

 

Article ID: Published Date: Last Revised Date: Platform: Control:
2928 11/26/2014 11/26/2014 WPF PivotGridControl
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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