Articles in this section
Category / Section

How to Wrap BI PivotGridControl and PivotSchemaDesigner as Custom Control for LightSwitch

2 mins read

Steps to create a sample in Light Switch Application:

  1. Open the Visual Studio, Click File->New Project and Open Light Switch Application(Visual C#).
  2. Create a new table or attach the Data Source by right-clicking the Data Sources in Solution Explorer Window or Project-> Add Data Source in Menu Bar.
  3. Here we have attached a Data Source using Northwind Entities Data .
  4. For that Click on OData Service in Attach Data Source wizard and click Next.
  5. Specify the OData Service endpoint as “http://services.odata.org/Northwind/Northwind.svc/” and click next.
  6. Select the tables you want and click finish. (Here we have used Order_Details Table in our Sample).
  7. After attaching Data Source, Add Screen by right-clicking the Screens in Solution Explorer Window or Project-> Add Screen in Menu Bar.
  8. In the Add New Screen Window Select “Editable Grid Screen” as Screen Template and “NorthwindEntitiesData.Order_Details” as Screen Data.
  9. By Default the Screen is viewed in DataGrid View.
  10. To view the screen in Pivot Grid view, follow the steps below:
  • Create a Silverlight Class Library by adding new project.
  • Right Click the Class Library and add a new Silverlight User Control.
  • In the User Control window add a PivotGrid control.
  • Add the rows, columns, Calculation items in the Pivot Grid Control.(Note that the Field Mapping Name of rows, columns and calculation item should be occurred in Table)
  • The Item Source property of the Pivot Grid Control can be binded by giving “itemSource=” {Binding Screen.Order_Details}” “.
  • Add Pivot Schema Designer.
  1. Now add a Custom Control in Screen by Clicking Add-> New Custom control in designer page
  • Add the User Control by clicking the Add Reference button in window and selecting your Silverlight class library in Projects.
  • Build the solution and Run.

C:\Users\labuser\Dropbox\Screenshots\Screenshot 2014-05-26 15.51.22.png

Figure: Custom Control displaying Pivot Grid only

 

C:\Users\labuser\Dropbox\Screenshots\Screenshot 2014-05-26 15.51.37.png

Figure: Custom control displaying both pivot Grid and Schema Designer

 

 

 

 

 

 

 

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied