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 - Looking for event before the database is queried
posted

I'm looking for an event that fires before the SSAS database gets queried.  I want to be able to modify the Columns/Rows/Measures/Filter of the datasource programatically before every call to the database.

Example:
User drags a measure into the grid to add it.  Then the grid gets updated with the new data.  I want to change the Columns/Rows/Measures/Filter that get sent before the grid updates with the new data.

I looked at pivotGrid.DataSource.PropertyChanged, but it fires a LOT on each action the user does.  This would probably work, but doesn't seem to be what I'm looking for.

I looked at pivotGrid.DataContextChanged but it didn't fire when I was expecting.

Thanks for any help on this.

-BEP

Parents Reply
  • 295
    Offline posted in reply to Robert Stoffers

    Hello again, Rob.

    In my XmlaDataSource, I'm defining the database, cube, and some rows and columns and measures.  My XamPivotDataSelector in my Expander is also connected to the same datasource as my PivotGrid.

    My Xaml for this proof of concept app is in this thread:
    http://ko.infragistics.com/community/forums/t/83237.aspx

    The XmlaDataSource_InitXmlaMethod gets called 10 times during startup because of the Pivot Grid and Selector being bound to the datasource.  That means my code to manage a filter gets run that many times when the app starts up and I'd rather not have that happening.

    What I'm trying to do is force a filter onto the person using the application.  I need to programatically check to make sure the filter is there each time data is retrieved in case they've deleted the filter in the GUI.  If it's not there, then I'll add it back.  Or, delete the filter each time data is about to be fetched if it exists and always add it back.  This is in case they changed the selected choices for that filter.

    For the adding/subtracting filters, I was looking at these threads:
    http://ko.infragistics.com/community/forums/p/53796/278254.aspx#278254
    http://ko.infragistics.com/community/forums/t/60223.aspx 

    Using XmlaDataSource_InitXmlaMethod may actually work, but it gets called so many times at startup, I'd like to either not subscribe to the event until most of the stuff is completed on startup or flag my code in the event handler not to run until most of the app has finished the initial loading.

    Do you know of a way to do this?  Or, is there a better event to subscribe to that fires when everything is finished at the initial loading of the app?  I could handle that event and then add my subscription to XmlaDataSource_InitXmlaMethod for subsequent calls.

    -BEP

    ps.  I posted Xaml in the other thread that I linked above using the code tags.  How do I put Xaml in these forums that gets color-coded and indented like I see other people doing?

Children