Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
DataBinding to xamPivotGrid.ServerUri
posted

I am evaluating the xamPivotGrid and am running into a problem setting up the xmla data source in Xaml. If I define the data source as follows then the grid connects and shows data.

 

<ig:XamPivotGrid Name="xamPivotGrid1">
                <ig:XamPivotGrid.DataSource>
                    <olap:XmlaDataSource
                             ServerUri="http://localhost/olap/msmdpump.dll"
                             Database="DB"
                             Cube="DBCube"
                             Columns="[Grade].[Grade]"
                             Rows="[Commodity].[Commodity]"
                             Measures="Weight"/>
                </ig:XamPivotGrid.DataSource>
            </ig:XamPivotGrid>

However, I want the ServerUri, Database and Cube to be based on the values passed in via the Application.Current.InitParams collection of Silverlight, and I want to bind to these values.

I have a class that I can bind to that returns the Application.Current values for the properties I am interested in, and when I bind to them on a textbox I see the value I excpect.

<TextBox Text="{Binding Source={StaticResource OlapServerUri}, Converter={StaticResource App}}"/>

this will display http://localhost/olap/msmdpump.dll in the textbox. However, if I try the following for the data source on the pivot grid the silverlight page will not load.

<ig:XamPivotGrid Name="xamPivotGrid1">
                <ig:XamPivotGrid.DataSource>
                    <olap:XmlaDataSource
                             ServerUri="{Binding Source={StaticResource OlapServerUri}, Converter={StaticResource App}}"
                             Database="DB"
                             Cube="DBCube"
                             Columns="[Grade].[Grade]"
                             Rows="[Commodity].[Commodity]"
                             Measures="Weight"/>
                </ig:XamPivotGrid.DataSource>
            </ig:XamPivotGrid>

I dont understand what the issue could be here. If the binding works for the text field of the text box, why doesnt it work for the ServerUri property? Is there something Im missing?

Cheers