This is a migrated thread and some comments may be shown as answers.

XMLAFilterDescription

2 Answers 22 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Riccardo
Top achievements
Rank 1
Riccardo asked on 03 Feb 2015, 02:23 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Polya
Telerik team
answered on 06 Feb 2015, 01:20 PM
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.

 
0
Riccardo
Top achievements
Rank 1
answered on 09 Feb 2015, 06:23 PM
Thank you very much Polya, it works exactly as I needed it to do!
Thank you again,
Riccardo
Tags
PivotGrid
Asked by
Riccardo
Top achievements
Rank 1
Answers by
Polya
Telerik team
Riccardo
Top achievements
Rank 1
Share this question
or