locked
PivotViewer: load the filters first, and then the data later? RRS feed

  • Question

  • Is there a way to load all the selection of filters down the left-side pane before loading the actual data?

    I would like my users to first select at least one filter from the left-side filter pane before the PivotViewer loads the data.

    At the moment, the PivotViewer loads all the rows and then allows the user to filter. I just want all the available filters to be presented first at page load, and then upon selection of a filter, the data is loaded.

    NOTE: I'm not looking for a UI hack like setting something to 'collapsed'; the whole purpose is to limit the size of the dataset retrieved.

    Page_Load()
    {
        //how to do this?
    
        pivotViewer1.??? <Load filter pane first>
    }

    var query = from c in context.Customers select c;

    if (<filter event is fired>)  // how to do this? { pivotViewer1.Itemsource = query; }


       



    • Edited by 000ABC Tuesday, November 26, 2013 3:28 AM
    Tuesday, November 26, 2013 2:40 AM

All replies

  • Hi,

    I am not clear about the intention of your project. However, you may refer to the sample from the link below and there is detailed source code attached.

    Lessons in PivotViewer

    http://pivotviewerlessons.codeplex.com/

    Please provide us with more details to troubleshoot if it does not help.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, November 27, 2013 3:09 AM
  • Yunjie, thank you for the response, appreciated.

    I've already seen those lessons and many more; however, my issue remains unresolved.

    Let me explain again...

    When the below code is executed, the PivotViewer loads ALL the data; this works fine:

    var query =
        from c in context.Customers
        select c;
    
    pivotViewer1.ItemsSource = query.ToList();

    The above code will load ALL the records from my Customers table and display them as zoomable 'tiles' on main canvas of the PivotViewer. In addition, the PivotViewer will also load a list of user selectable filters down the left-side pane which I've defined in XAML. e.g.

    <sdk:PivotViewerStringProperty Id="Gender" DisplayName="Gender" Binding="{Binding Gender}" Options="CanFilter"/>
    
    <sdk:PivotViewerStringProperty Id="Location" DisplayName="Location" Binding="{Binding Location}" Options="CanFilter"/>

    I would simply like NO records or 'tiles' to be loaded until the user first selects a filter from the left-side pane.

    I do not wish to load ALL the records first and then have the user select a filter to narrow the resultset. Neither am I looking for a hack where ALL the records are loaded and hidden until the user selects a filter.

    Does this make sense?

         

    Wednesday, November 27, 2013 4:51 AM
  • Hi,

    Are you searching for the filter methods in PivotViewer? If so, you may have a look at this article below:

    Programmatically setting the PivotViewer Filter

    http://stevenhollidge.blogspot.in/2012/11/programmatically-setting-pivotviewer.html

    "You can preconfigure the Silverlight PivotViewer to contain a filter in code, here is how. If you have a ‘CouponToday’ decimal property and wanted to set Greater than 5 and Less than 10."

    Hope it helps.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Saturday, November 30, 2013 6:28 AM
  • Thank you for the response; however, this does NOT resolve or answer the question. Let me explain yet AGAIN...

    1. On page load, I want the PivotViewer to initialized and ready for use: I want the filter pane to load all the possible filters.

    2. However, at this stage, when page load completes, I want NO tiles or results to be displayed.

    3. After page load completes, if the user now selects a filter, the tiles/results begin to appear. 

    Does this make sense?

    Another way to think about it: Is there a way of setting the DataContext/structure/schema of the PivotViewer and NOT load the actual data until the user selects a filter?

    The following article is sort of useful; however, it 'pages' the data and still initially displays an arbitrary number of tiles (100 tiles) on load:

    • tonychampion<DOT>net/blog/index.php/2011/12/pivotviewer-basics-dynamic-collections/

    I simply want to display NO tiles on load, but only display the filter pane options on page load. Then, once page load completes, the user can then select a filter to fetch and display tiles.

    I really can't re-phase this question any other way, and I've thoroughly Google'd for an answer; I guess there is no solution...

    Sunday, December 1, 2013 3:32 AM
  • Hi there,

    It's not sure if it is possible to show filter only, unfortunately checking and debugging code is beyond the scope of a forum post. Please feel free to open support incidents via http://msdn.microsoft.com/en-us/hh361695?WT.mc_id=SMCfoot_ENUS_TEXT

    Regards,

    Jenny

    Friday, January 17, 2014 6:17 AM