XMLAFilterDescription

3 posts, 1 answers
  1. Riccardo
    Riccardo avatar
    4 posts
    Member since:
    Oct 2014

    Posted 03 Feb 2015 Link to this post

    Hi.
    In my Visual Studio solution I use your PivotGrid and PivotFieldList to display a cube: I need to filter all the values in it according to the selected sale point, which is chosen through a combo box. I tried to do it using a Filter, which has been created in the code-behind. My problem is that the user should not be able to edit or delete it in any way. Is there a way to make this filter "blocked", so that the user can't move it? If it isn't, is there a way to filter all the values according to this parameter? I can't use Analysis services roles because there are hundreds of sales point to manage.
    This is the code I use:

    filtroPV = new XmlaFilterDescription();
    filtroPV.MemberName = "[Punti Vendita].[Id]";
    OlapSetCondition cond = new OlapSetCondition();
    cond.Comparison = Telerik.Pivot.Core.Filtering.SetComparison.Includes;
    cond.Items.Add("[Punti Vendita].[Id].&[7300]");
    filtroPV.Condition = cond;
    filtroPV.SettingsChanged += filtroPV_SettingsChanged;

    Thank you in advance,
    Riccardo
  2. Answer
    Polya
    Admin
    Polya avatar
    200 posts

    Posted 06 Feb 2015 Link to this post

    Hello Riccardo,

    In order to achieve the desired effect I can suggest setting IsEnabled = false to the corresponding FieldBoxItem to your description - "[Punti Vendita]".
    You can change the FieldBoxItemStyle and set the IsEnables property depending on the description using a IValueConverter. This way the users will not be able to remove this filter from the Filters box.

    I've prepared a sample project demonstrating this approach. You can find it attached. Please note that the project uses implicit styles.
    Hopefully this helps and is suitable to your scenario.

    Regards,
    Polya
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. DevCraft banner
  4. Riccardo
    Riccardo avatar
    4 posts
    Member since:
    Oct 2014

    Posted 09 Feb 2015 Link to this post

    Thank you very much Polya, it works exactly as I needed it to do!
    Thank you again,
    Riccardo
Back to Top