Using XamPivotGrid and RIA Services.

Atanas Dyulgerov / Monday, June 21, 2010

Using RIA services with XamPivotGrid is very similar to using RIA services with the XamDataGrid. The three basic steps that you need to take are:

  1. Create a project that supports RIA services
  2. Create a DomainDataSource.
  3. Bind the XamPivotGrid's DataSource property to the DomainDataSource.

The first two steps are described verbosely with loads of screen shots in this article from the Infragistics online help system. The article was originally written for XamDataGrid, but the steps in it are absolutely identical for the XamPivotGrid all the way up to the point where the article instructs you to "Drag the Employee class from the Data Sources window to the layout of the Silverlight client application." and then it shows a screenshot of Visual Studio and a XamDataGrid in the designer section plus some code in the XAML section.

After you have dragged the Employee class in the designer its code will have been generated for you - as shown in the screen shot from the article - it will be named employeeDomainDataSource. All you need to do now is add an instance of XamPivotGrid to your application and bind the control's DataSource property to the DomainDataSource's Data property.

   <ig:XamPivotGrid x:Name="xamPivotGrid"
         DataSource="{Binding Source=employeeDomainDataSource, Path=Data}" />
 

So using the article in the help system you only need to change the XamGrid control with XamPivotGrid and instead of binding the ItemsSource property you need to bind the DataSource property. If you want to add a XamPivotDataSelector to your application, you can bind the XamPivotDataSelector control's DataSource property to the XamPivotGrid control's DataSource property like this:

   <ig:XamPivotDataSelector x:Name="xamPivotDataSelector"
         DataSource="{Binding Source=xamPivotGrid, Path=DataSource}" />
 

I hope this is helpful for you. If you have any questions, feedback, any comments, please feel free to leave a comment or write to me at adyulgerov@infragistics.com

Have a great day!