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
295
xamPivotGrid with RIA Service
posted

Hi,

I'm trying to implement xamPivotGrid with RIA Services. with below code. But pivotgrid does not return any data. I checked from code behind DataSource is showing Null value. But my Domain Source returning 22 records. Let me know if I need to do anything else in my code behind.

Please Help. Thanks in Advance.

<UserControl x:Class="BTSCSFManagement.CSFManagement"

    xmlns=" http://schemas.microsoft.com/winfx/2006/xaml/presentation "

    xmlns:x=" http://schemas.microsoft.com/winfx/2006/xaml "

    xmlns:d=" http://schemas.microsoft.com/expression/blend/2008 "

    xmlns:mc=" http://schemas.openxmlformats.org/markup-compatibility/2006 "

    mc:Ignorable="d"

    d:DesignHeight="300" d:DesignWidth="400" xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"

    xmlns:my="clr-namespace: BTSCSFManagement.Web"

    xmlns:ig="http://schemas.infragistics.com/xaml">

   

    <Grid x:Name="LayoutRoot" Background="White">

        <Grid.ColumnDefinitions>

            <ColumnDefinition />

            <ColumnDefinition Width="Auto" />

        </Grid.ColumnDefinitions>

        <riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance my:vwTranDetail, CreateList=true}" Height="0"

                LoadedData="vwTranDetailDomainDataSource_LoadedData" Name="vwTranDetailDomainDataSource" QueryName="GetVwTranDetailsQuery" Width="0">

            <riaControls:DomainDataSource.DomainContext>

                <my:CSFContext />

            </riaControls:DomainDataSource.DomainContext>

        </riaControls:DomainDataSource>

        <ig:XamPivotGrid

            x:Name="pivotGrid"

            Grid.Column="0"

            DataSource="{Binding Source=vwTranDetailDomainDataSource, Path=Data}" 

            AllowCompactLayout="True" />

        <ig:XamPivotDataSelector

            x:Name="xamPivotDataSelector"

            Grid.Column="1"

            DataSource="{Binding Source=pivotGrid, Path=DataSource}" />

    </Grid>

</UserControl>

Sandip

Parents
  • 8831
    Verified Answer
    posted

    Hello,

    Try it in this way:

     

    <UserControl x:Class="BTSCSFManagement.CSFManagement"

        xmlns=" http://schemas.microsoft.com/winfx/2006/xaml/presentation "

        xmlns:x=" http://schemas.microsoft.com/winfx/2006/xaml "

        xmlns:d=" http://schemas.microsoft.com/expression/blend/2008 "

        xmlns:mc=" http://schemas.openxmlformats.org/markup-compatibility/2006 "

        mc:Ignorable="d"

        d:DesignHeight="300" d:DesignWidth="400" xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"

        xmlns:my="clr-namespace: BTSCSFManagement.Web"

        xmlns:ig="http://schemas.infragistics.com/xaml"

        xmlns:FlatData="clr-namespace:Infragistics.Olap.FlatData;assembly=InfragisticsSL4.Olap.FlatData.v10.2">

     

        <Grid x:Name="LayoutRoot" Background="White">

            <Grid.Resources>

                <riaControls:DomainDataSource x:Key="domainDataSource"

                                      AutoLoad="True"

                                      d:DesignData="{d:DesignInstance my:vwTranDetail, CreateList=true}"                

                                      LoadedData="vwTranDetailDomainDataSource_LoadedData"

                                      Name="vwTranDetailDomainDataSource" QueryName="GetVwTranDetailsQuery">

                    <riaControls:DomainDataSource.DomainContext>

                        <my:CSFContext />

                    </riaControls:DomainDataSource.DomainContext>

                </riaControls:DomainDataSource>

     

     

                <FlatData:FlatDataConnectionSettings x:Key="flatDataSettings"

                                                ItemsSource="{Binding Source={StaticResource domainDataSource}, Path=Data}"/>

     

                <FlatData:FlatDataSource x:Key="flatDataSource"

                                         ConnectionSettings="{StaticResource flatDataSettings}">

     

                    <!-- Overriding the default meta attributes -->

                    <FlatData:FlatDataSource.CubesSettings>

                        <FlatData:CubeMetadata DataTypeFullName="[Your data items full type name here]" DisplayName="RIA Data">

                        </FlatData:CubeMetadata>

                    </FlatData:FlatDataSource.CubesSettings>

     

                </FlatData:FlatDataSource>

            </Grid.Resources>

     

            <Grid.ColumnDefinitions>

                <ColumnDefinition />

                <ColumnDefinition Width="Auto" />

            </Grid.ColumnDefinitions>

     

            <ig:XamPivotGrid

                x:Name="pivotGrid"

                Grid.Column="0"

                DataSource="{StaticResource flatDataSource}"

                AllowCompactLayout="True" />

            <ig:XamPivotDataSelector

                x:Name="xamPivotDataSelector"

                Grid.Column="1"

                DataSource="{StaticResource flatDataSource}"/>

        </Grid>

    </UserControl>

     

    Please note that in the data selector you wouldn’t have databases but the cube only. Also specify the full type name of your entity objects (the line with yellow background) in order to get friendly name to appear into cubes dropdown.

     

    Plamen.

     

     

Reply Children
No Data