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
610
Cannot set ItemSource multiple times
posted

Hi,

I have seen some problems in using the pivot grid and I can reproduce it with the sample code coming with WPF DV 2010 v2 feature browser.

The changes I made to the sample code:

1. Add a button in FlatDataSource (XAML) xaml file which is DataSourceFlatDataXAML.xaml:

        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="Auto" />
           <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <igPivot:XamPivotGrid x:Name="pivotGrid" DataSource="{StaticResource FlatDataSource}" />

        <igPivot:Expander Grid.Column="1">
            <igPivot:XamPivotDataSelector x:Name="dataSelector" DataSource="{StaticResource FlatDataSource}"  />
        </igPivot:Expander>
      <WrapPanel Grid.Column="2">
        <Button Name="Invoke" Content="Refresh" Click="Invoke_Click"/>
      </WrapPanel>

2. Add Invoke_Click method in DataSourceFlatDataXAML.cs:

      private void Invoke_Click(object sender, System.Windows.RoutedEventArgs e) {
        (this.pivotGrid.DataSource as FlatDataSource).ItemsSource = SampleDataGenerator.GenerateSales(500);
      }


When I run the modified app, the FlatDataSource (XAML) sample displays correctly on initial load, but not after I click "Refresh" button. The cube display is gone.

I wonder if there's a simple setting to re-initialize the state, but haven't found any in the documentation.

Please help.

Thanks,

Yu