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

Setting filters/rows etc in code

6 Answers 61 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Glen
Top achievements
Rank 1
Glen asked on 29 Oct 2013, 11:19 AM
Hi, do you have a code example that shows how to set a filter, row, column etc in code?  I have implemented the serializer for storing the entire state but would like to manually set up certain filters on the query. 

6 Answers, 1 is accepted

Sort by
0
Rosen Vladimirov
Telerik team
answered on 29 Oct 2013, 12:31 PM
Hi Glen,

In our Populating with Data articles you will find out how to set different descriptions for the respective DataProvider with three languages - XAML, C# and Visual Basic. You can take a look at them here:
 - LocalDataSourceProvider
 - XmlaDataProvider

Hopefully this helps. Feel free to contact us in case you have any problems or concerns.

Regards,
Rosen Vladimirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Glen
Top achievements
Rank 1
answered on 29 Oct 2013, 04:58 PM
Hi, thanks, I've got it working :) Is there any way to add filters but hide them from the UI so that users cannot remove them?
0
Rosen Vladimirov
Telerik team
answered on 30 Oct 2013, 10:00 AM
Hello Glen,

Do you mean that you want to hide them from RadPivotFieldList? If you are using only RadPivotGrid (without RadPivotFieldList) the users will not be able to remove any filters, group descriptions or aggregates.

Could you clarify what is the scenario that you want to achieve?

Regards,
Rosen Vladimirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Glen
Top achievements
Rank 1
answered on 30 Oct 2013, 11:09 AM
Actually I just realised my filter isn't being applied correctly.  The filter is displaying in the field list however the items aren't checked correctly.  In the VS output window I am seeing

System.Windows.Data Error: BindingExpression path error: 'IsSelected' property not found on 'Telerik.Windows.Controls.FieldList.Editing.ItemsSetFilterViewModel' 'Telerik.Windows.Controls.FieldList.Editing.ItemsSetFilterViewModel' (HashCode=46719429). BindingExpression: Path='IsSelected' DataItem='Telerik.Windows.Controls.FieldList.Editing.ItemsSetFilterViewModel' (HashCode=46719429); target element is 'System.Windows.Controls.CheckBox' (Name=''); target property is 'IsChecked' (type 'System.Nullable`1[System.Boolean]')

 

 

XmlaFilterDescription topFilterDescription = new XmlaFilterDescription();
          topFilterDescription.MemberName = "[Book].[Book Code]";
 
          OlapSetCondition condition1 = new OlapSetCondition();
          condition1.Comparison = SetComparison.Includes;
          condition1.Items.Add("[Book].[Book Code].&[AAAA400]");
 
          XmlaLevelFilterDescription levelFilterDescription1 = new XmlaLevelFilterDescription();
          levelFilterDescription1.MemberName = "[Book].[Book Code]";
          levelFilterDescription1.Condition = condition1;
          topFilterDescription.Levels.Add(levelFilterDescription1);
 
          dp.FilterDescriptions.Add(topFilterDescription);

 

 

 

0
Rosen Vladimirov
Telerik team
answered on 04 Nov 2013, 07:03 AM
Hi Glen,

When you use Hierarchical filters you cannot specify a filter for the top-level item as in most of the cases this item just marks the full hierarchy. Also the Member Name must point to the unique name of each member in the hierarchy. In your case the topFilterDescription and levelFilterDescription1 have the same Member name, which is not allowed. I've prepared a sample project for you to demonstrate how to handle hierarchies and filters via RadPivotGrid. Please give it a try and inform us in case you have any problems or concerns.

Regards,
Rosen Vladimirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Glen
Top achievements
Rank 1
answered on 07 Nov 2013, 03:51 PM
Thanks, it's working now
Tags
PivotGrid
Asked by
Glen
Top achievements
Rank 1
Answers by
Rosen Vladimirov
Telerik team
Glen
Top achievements
Rank 1
Share this question
or