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
335
LoadCubesCompleted event seems to fire multiple times
posted

Hi,

I navigate a new page to load the cubes. When I navigate to new page I connect to my cube database but it not seems to load the Cubes. So I have add a listener after connected.


           this.PivotGrid.DataSource.LoadSchemaAsync();
           this.PivotGrid.DataSource.LoadCubesCompleted += new EventHandler<LoadCubesCompletedEventArgs>(DataSource_LoadCubesCompleted);

private void DataSource_LoadCubesCompleted(object sender, LoadCubesCompletedEventArgs e)
{
      if (this.PivotGrid.DataSource.Cubes.Count > 0)
        {     
               this.dataProvider.LoadDimensionsAsync("CubeName");           

                         this.PivotGrid.DataSource.LoadDimensionsCompleted +=

                                              new EventHandler<AsyncCompletedEventArgs>(DataSource_LoadDimensionsCompleted);

                  }

}

After loading all cubes I call the Dimensions Load. And Fetch the Xml data to pivot grid. But DataSource_LoadDimensionsCompleted is fired more than once. So the Fill method add only row to grid. And fire the Fill () method secondly. Second time it add row again and failes. 

public void DataSource_LoadDimensionsCompleted(object sender, AsyncCompletedEventArgs e)
{
          XMLSerializedView.Fill();
}

I call after the Fill() method that:

this.PivotGrid.DataSource.LoadDimensionsCompleted -= new EventHandler(DataSource_LoadDimensionsCompleted);

But it does not solve my problem.How can I control the cube and dimensions loading ?

Parents Reply Children